svenstaro/flamejam — pull request #112 by sigvef (2013-06-14 02:22:43+00:00)
Title: Optimize speed

This pull request is my humble attempt at speeding up flamejam, mainly by tweaking sqlalchemy loading strategies.

I've tested by loading the jam/jam_games view on a jam with ~1000 games and a ~1000 participants. Before optimization, this took around 18 seconds to complete. After optimization, this takes about 2 seconds, which is something like a **90% reduction** in loading times.

Other 'non-heavy' views take about 1 second to complete, which seems a bit slow to me, but I can't figure out what is causing it.

I unceremoniously axed the #-th-jam-column for the participants list for a given jam, as it was causing slowdowns I didn't know how to fix. Let me know if this should be put back in.

In changing some of the sqlalchemy settings, methods like .count() and .all() no longer work on certain collections. I have tried to find all the places where the old methods were used and replaced them with their equivalents, but I am not sure that everything has been found. If something is missed, it could cause run-time errors.

I'd squash/prettify the commit messages, but I don't know how.