-
Notifications
You must be signed in to change notification settings - Fork 451
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IO numbers of functions using DB stuff #2216
Comments
Investigated SQLiteCacheDB25 functions in Tribler call some of SQLiteCacheDB functions that return database objects. The functions that return database objects are listed with their callers below. get_cursor functionsqlitecachedbhandler.getSearchSuggestion -> uses cursor in function execute functiontracker_manager.add_tracker -> uses cursor in function db_upgrader.UPGRADE_FUNCTIONS (5) that execute -> besides the one mentioned below, the other 5 ignore the cursor, can be handled in the same way as update_tracker_info above. db_upgrader._upgrade_22_to_23 -> loops over a cursor two times, one can be replaced by fetchall, one cannot probably. test_sqlitedb.test_create_db -> Does not use the cursor, so can be the same solution as update_tracker_info executemany functionsqlitecachedbhandler.channelcastdbhandler.on_torrents_from_dispersy -> two times execute many, both ignore the cursor sqlitecachedbhandler.torrentdbhandler.addExternalTorrentNoDef -> ignores the cursor sqlitecachedbhandler.votecastdbhandler._flush_to_database -> ignores the cursor db_upgrade._upgrade_22_to_23 -> ignores the cursor execute_read functionCan be removed. It only calls execute and is only used internally by |
Multichain databaseA subclass of Database in Dispersy, uses a different 12 callers that get a database object (cursor). execute function
executescript
Question for @pimveldhuisen and @pimotte: How much refactoring would it be if these functions would start become asynchronous and return Deferreds and thus the callers of these functions would have to modified to handle this? |
Dispersy/database.pyexecute function
note Executemany functionAll 11 callers ignore the cursor being returned. (dispersy) (tribler)
executescript function25 calls to this function, 25/25 ignore the cursor (100%).
|
Check this for the three database managers and aggregate the numbers.
Including:
The text was updated successfully, but these errors were encountered: