Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PERF: Change asset finder to be backed by sqlite3.
Attack the startup bottleneck of creating the asset finders caches for a large universe, which was between 1-2 seconds on development and production machines. Instead, allow the AssetFinder to be passed a sqlite3 file that has already been populated and then hydrate asset objects only when an equity is referenced for the first time. To create aforementioned sqlite3, create an AssetFinder with an db_path and `create_table` set to True. If `create_table` is set to False, the prepopulated data in the sqlite file found at db_path will be used. Default behavior is to use an in memory database. Behavior that changes: - Fuzzy lookup now only works on one character, that character needs to be specified at write/metadata consumption time, since the fuzzy lookup key is created by dropping the character from each symbol. - Overwriting partially written metadata is no longer supported. i.e. some unit tests allowed for inserting just the identifier, and then later updating the symbol, end_date, etc. Instead of building an upsert behavior at this time, this patch changes the unit tests so that the data for each asset is only inserted once. Other notes: - populate_cache is now removed, since there is no longer a two step process of inserting metadata and then realizing that metadata into assets. _spawn_asset is rolled into insert_metadata, so that a call to insert_metadata both converts the metadata and makes it available in the data store.
- Loading branch information
Showing
5 changed files
with
528 additions
and
267 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.