leaguevine / leaguevine-ultistats

MIT License
18 stars 4 forks source link

Performance issues on substitution screen #17

Closed cboulay closed 12 years ago

cboulay commented 12 years ago

I tried out the playwithlv version on my Galaxy Nexus last night and saw that subbing players was very slow. Some of this might be due to the CSS, some of it might be due to my code. I'll try to find a faster solution in the near future.

cboulay commented 12 years ago

I sped this up by removing one jQuery selector and reducing the scope of another. I also used some temporary variables to reduce code redundancy in if-else structures.

I think overall these changes were very small.

I also noticed that the more times I toggled players, the longer each toggle took. I guess this means there is a memory leak somewhere. By using the Timeline inspector I determined the most likely culprit is layoutmanager. Views are being discarded whenever a player leaves one side of the list. Maybe we need to do something more to get rid of these.

cboulay commented 12 years ago

Close for now until the view leaks become a problem.

cboulay commented 12 years ago

I just realized that every substitution tap was also causing the (not visible) player action buttons to re-render. That can be fixed.

cboulay commented 12 years ago

It's better but still not fast enough. I might have to do it using direct view deletion/insertion instead of a general re-render. Another solution is to put ALL players in both on-field and off-field and toggle their display:hidden whenever they are tapped. Not very elegant but fast. Putting this on hold until other basic functionality is finished.