Considerit / ConsiderIt

For deliberation and opinion visualization
GNU Affero General Public License v3.0
90 stars 14 forks source link

Performance improvements, inspired by (...or guilted into by) a large scale forum #162

Closed tkriplean closed 1 year ago

tkriplean commented 1 year ago

Two structural performance improvements:

1) The main performance hangup was data transfer size. I improved the situation by, instead of fetching all proposal + opinion data all at once via fetch('/proposals'), now data can be fetched list-by-list (each focus). This allows us to be much more selective about which data to download. This will also allow for better responsivity for longer standing phased forums. Data from archival tabs won't have to be fetched.

2) The server was generating all proposal + opinion + pro/con data for a particular user every time someone accessed the forum. This led to significant lag and unnecessary computational effort, especially as forums increase in size. I improved the situation by caching proposal, opinion, and point data, and then post processing it for user-specific filtering on each request (see proposal.rb). I'm not a big fan of all the calls to Proposal.clear_cache sprinkled throughout the server code in order to invalidate the cache when some change is made, but it is what it is.

Client-side performance improvements include:

Client-side experience improvements include: