nicklockwood / FXForms

[DEPRECATED]
Other
2.93k stars 339 forks source link

Performance issue #314

Open gilthonweapps opened 9 years ago

gilthonweapps commented 9 years ago

Hi,

I have a Swift application that use your lib to create complex forms. My forms consist of about 10-15 fields. The number of fields depends on the values of some fields. For example, I may have a switch that adds/removes fields on the form.

Instead of using your default cells, I have created a dozen of custom cells inheriting from FXFormBaseCell and FXFormDefaultCell. They all have their associated NIB file so I can have the custom layout I want.

When I scroll the UITableView up or down on my iPhone 5S, I see that the animation is not really smooth. It flickers from time to time, it is a bit sluggish. If I do it on the simulator, everything is fine. I can see as well this behaviour with your Swift example on my device, but my app is worse as I use a lot of custom cell.

With Apple Instruments, I see a lot of calls to "- (UITableViewCell )cellForField:(FXFormField )field". I wonder if it is because you don't recycle cells.

Have you ever seen this behaviour? Do you have any suggestion to improve the performance as it is not really smooth? Unfortunately, I cannot post any code nor screenshot for privacy reason (app developed internally for my company).

nicklockwood commented 9 years ago

Yeah, I don't recycle cells, and that's problematic for performance. I want to fix that, but it's not trivial to ensure that properties are properly reset.

gilthonweapps commented 9 years ago

I really like your lib as it completely fulfills my needs. I see you have done a really great job here. I hope you will come with a solution to recycle cells :-)

gilthonweapps commented 9 years ago

Hi again,

Maybe you should have a look at this lib: https://github.com/xmartlabs/XLForm It seems they managed to handle the recycling of the cells quite well.