0

I'm using parceler, and I'm trying to define a structure like this one:

Category 1..* Product 1..* Images

Each entity has a list, and a parent instance, like this

@Parcel
public class Category {
    List<Product> products;
    ...
}

@Parcel
public class Product {
    List<Image> images;
    Category parent;
    ...
}

@Parcel
public class Image {
    Product parent;
    ...
}

I want to know how performance is affected when I do:

Category c = getSampleCategory(); // With products and images
Parcels.wrap(c);

and pass a Category object as an extra between activities. I'm noticing ANRs and I ask myself if this is one of the causes

Thanks in advance

voghDev
  • 5,641
  • 2
  • 37
  • 41

1 Answers1

0

Parceler uses annotation processing and, in turn, generated code to marshal your data to and from the Bundle / Intent / Parcel. This means that the Parcels.wrap / Parcels.unwrap calls should be very performant. I'd encourage you to run your own performance benchmark (surround you calls with timer logging) around the various parts of your code, including the wrap / unwrap calls to ensure that things are taking a reasonable amount of time. If you do find that Parceler is not meeting expectations (is a source of your ANRs) please file an issue on the Parceler issue list on Github.

John Ericksen
  • 10,995
  • 4
  • 45
  • 75