I'm using Jackson with DataBind library to parse json and map it java object. I'm also using Gson on other project where perf is less required.
On 17 Feb, LoganSquare library is first released, promising 4-10 time faster parsing as Gson.
I understand it can be a primarly opinion base question, so be as technic and specific as possible and base your answer on real data.
Well to be clear if you are releasing your app to devices with ART you will have a huge speed advantage trough parsing.
so i will explain my experience with logansquare so far.
pros :
LoganSquare.parseList()
cons :
NO REALM DB : I could't make it run with Realm db so far(I didnt tried hard yet)
Custom Type Adapter :Couldn't find a type adapter or something similar so far but I am not sure.
see their benchmark here
and here is my poor benchmark results(it is not a proper benchmark but it is something): Emulator nexus 5, with DalvikVM,4.2 jellybean
import com.bluelinelabs.logansquare.annotation.JsonField;
import com.bluelinelabs.logansquare.annotation.JsonObject;
import com.google.gson.annotations.SerializedName;
/**
* Created by Ercan on 6/26/2015.
*/
@JsonObject(serializeNullCollectionElements = true ,serializeNullObjects = true)
public class Village {
@SerializedName("IdVillage")
@JsonField(name ="IdVillage")
String tbsVillageId;
@SerializedName("TBS_VillageId")
@JsonField(name ="TBS_VillageId")
String townRefId;
@SerializedName("VillageName")
@JsonField(name ="VillageName")
String villageName;
@SerializedName("Status")
@JsonField(name ="Status")
String status;
@SerializedName("DateInserted")
@JsonField(name ="DateInserted")
String dateInserted;
@SerializedName("DateLastModified")
@JsonField(name ="DateLastModified")
String datelastModified;
public String getTbsVillageId() {
return tbsVillageId;
}
public void setTbsVillageId(String tbsVillageId) {
this.tbsVillageId = tbsVillageId;
}
public String getTownRefId() {
return townRefId;
}
public void setTownRefId(String townRefId) {
this.townRefId = townRefId;
}
public String getVillageName() {
return villageName;
}
public void setVillageName(String villageName) {
this.villageName = villageName;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getDateInserted() {
return dateInserted;
}
public void setDateInserted(String dateInserted) {
this.dateInserted = dateInserted;
}
public String getDatelastModified() {
return datelastModified;
}
public void setDatelastModified(String datelastModified) {
this.datelastModified = datelastModified;
}
}
I have run LoganSquare Benchmark project on my Nexus 5 device with Android 6.0.1 and here is the result:
Also, after a short time spend with the lib, here are my pros and cons:
Pros
Cons
I wrote an example project to see how LoganSquare works and also a blog post, so take a look there for more information.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With