louking / members

member activity management
Other
1 stars 2 forks source link

task details takes too long to load #511

Open louking opened 2 years ago

louking commented 2 years ago

Is there any way this could be made a server based view?

note may need self referential many to many query, e.g., https://stackoverflow.com/questions/52408644/how-can-i-write-a-sqlalchemy-query-that-will-return-all-descendants-of-a-node-in

search stackoverflow: https://stackoverflow.com/search?q=%5Bsqlalchemy%5D+self+referential+many+to+many+query

Note

louking commented 2 years ago

WIP: https://github.com/louking/members/commit/cc0b5a83f9d1d2b83c6c1ae1ddd9fc0438d98450

louking commented 2 years ago

This process currently runs the task checklist view for each membertility "member". @hhlanglois suggested trying to figure out where the processing is slow for that process and speeding that up. There are clearly some inefficiencies in the processing due to the _get_status being called for several fields, which could potentially be cached. Also possible is that the database indexes could be optimized to speed up the lookups.

See https://github.com/pyutils/line_profiler

louking commented 2 years ago

A 28 sec load time improved to about 17 seconds. Better but not great. Leaving this open for now if I have time to continue working on it.