justinweiss/dragongoclient — pull request #6 by adum (2011-12-11 00:59:53+00:00)
Title: SQLite integration

this branch is all about speeding up the client. i play about 40 games at a time, and need it to go quickly! :)

This set of changes integrates SQLite into the client, storing game records in a local database. when the table page becomes visible, it only reloads the games if the interval has passed (5 mins by default). previously, it would reload every time you made a move.

after the game list has loaded, the app tries to prefetch the SGF for each game in the background such that loading is instant and doesn't require a network fetch.

in FuegoBoard, there was an O(n^2) operation for loading games, where it called GoInDirection repeatedly until the end. the problem was that GoInDirection internally executed every node up to the new node for each step due to what i would call internal Fuego laziness. now it skips to the end quickly. this cuts two or three seconds off a game load on my iphone 4 for games that have a lot of moves.

in the original, after submitting a move, the app would wait to confirm its acceptance before continuing. that delay drove me nuts, so i simply took that out confirmation, which works 98% of the time for me. 2% of the time it fails to submit the move and you have to redo it later. this i need to fix by saving moves into SQLite and doing them in the background, which would also enable true offline play.