-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Greatly improve database performance for
esgpull update
(#47)
* feat(db): faster insertions for new items * feat(cli.update): faster link/unlink query & file new(db): Database.commit_context for bulk transactions changed(cli.update): direct insert/delete into query_file table changed(cli.update): bulk insert/delete instead of per file * feat(cli.update): show current query in progress bar * test(cli.update): less than 30 seconds to fetch ~6k files * fix: renamed * test(cli.update): proper setup for test installs * test(selection): proper teardown fixtures, avoids messing other tests
- Loading branch information
Showing
10 changed files
with
115 additions
and
27 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
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
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
Empty file.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
from time import perf_counter | ||
|
||
from click.testing import CliRunner | ||
|
||
from esgpull.cli.add import add | ||
from esgpull.cli.config import config | ||
from esgpull.cli.self import install | ||
from esgpull.cli.update import update | ||
from esgpull.install_config import InstallConfig | ||
|
||
|
||
def test_fast_update(tmp_path): | ||
InstallConfig.setup(tmp_path) | ||
install_path = tmp_path / "esgpull" | ||
runner = CliRunner() | ||
result_install = runner.invoke(install, [f"{install_path}"]) | ||
assert result_install.exit_code == 0 | ||
result_config = runner.invoke(config, ["api.page_limit", "10000"]) | ||
assert result_config.exit_code == 0 | ||
result_add = runner.invoke( | ||
add, | ||
[ | ||
"table_id:fx", | ||
"experiment_id:dcpp*", | ||
"--distrib", | ||
"false", | ||
"--track", | ||
], | ||
) | ||
assert result_add.exit_code == 0 | ||
start = perf_counter() | ||
result_update = runner.invoke(update, ["--yes"]) | ||
stop = perf_counter() | ||
assert result_update.exit_code == 0 | ||
assert stop - start < 30 # 30 seconds to fetch ~6k files is plenty enough | ||
InstallConfig.setup() |
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