Commit Graph

5 Commits

Author SHA1 Message Date
Jeffrey Han
40a800eb76 Changed cached OsuFile loading.
Instead of being loaded individually from the database, OsuFiles are now loaded in batch by traversing the database.  In most cases, this should cause a ~10% loading speed improvement.  Defaults to the previous approach if few OsuFiles are being loaded.

Other changes:
- Don't drop indexes upon batch insertion if few entries are being inserted.
- Trying to increase fetch size with setFetchSize(100).
- Added more parser statuses.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-03-07 23:24:19 -05:00
Jeffrey Han
c6041d8cba Added more checks for failed database connections.
Should prevent unnecessary null pointer exceptions if anything goes wrong.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-03-07 20:39:27 -05:00
Jeffrey Han
5e9d9a491c SQLite optimizations. (addressing #34)
- Added indexes.
- Only call OsuDB.insert() if necessary.
- Drop/recreate indexes for batch inserts.
- Added pragmas for "locking_mode" and "journal_mode".

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-03-07 18:05:18 -05:00
Jeffrey Han
4959510b5d Deleting beatmaps/groups now also deletes them from the cache.
Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-03-04 21:45:44 -05:00
Jeffrey Han
bf04083ebd Added a beatmap cache database.
- New database ".opsu.db" stores a cached copy of all parsed beatmaps.  All data will be read from this database unless the last modified time of a beatmap file does not match the one in the table.
- OsuParser inserts all new entries to the database in batch after parsing.
- Added *toString()/*fromString() methods for 'breaks', 'timingPoints', and 'combo' fields in OsuFile for use with the database.
- For any database format changes, update the DATABASE_VERSION field in OsuDB.
- Reloading beatmaps (F5) will now clear the beatmap cache.

Related changes:
- Added small DBController class for convenience.
- Changed 'bg' field of OsuFile to only contain the image file name, instead of the full path.
- Deleted printDatabase() method from ScoreDB.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-03-04 21:03:06 -05:00