Skip to content
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

speedup for reading and writing cached data with sqlalchemy #48

Merged
merged 3 commits into from
Sep 14, 2023

Conversation

karlicoss
Copy link
Owner

No description provided.

…amed

```
before
src/cachew/tests/test_cachew.py::test_many[gc_off-1000000] [INFO    2023-09-13 03:31:29,980 cachew __init__.py:778 ] cachew.tests.test_cachew:test_many.<locals>.iter_data: wrote   1000000 objects to   cachew (sqlite /tmp/pytest-of-karlicos/pytest-18/test_many_gc_off_1000000_0/test_many)
test_many: initial write to cache took 4.5s
test_many: cache size is 72.904704Mb
[INFO    2023-09-13 03:31:30,273 cachew __init__.py:641 ] cachew.tests.test_cachew:test_many.<locals>.iter_data: loading 1000000 objects from cachew (sqlite /tmp/pytest-of-karlicos/pytest-18/test_many_gc_off_1000000_0/test_many)
test_many: reading from cache took 2.9s
```

after:
```
src/cachew/tests/test_cachew.py::test_many[gc_off-1000000] [INFO    2023-09-14 20:50:55,287 cachew __init__.py:791 ] cachew.tests.test_cachew:test_many.<locals>.iter_data: wrote   1000000 objects to   cachew (sqlite /tmp/pytest-of-karlicos/pytest-80/test_many_gc_off_1000000_0/test_many)
test_many: initial write to cache took 3.3s
test_many: cache size is 72.904704Mb
[INFO    2023-09-14 20:50:55,479 cachew __init__.py:654 ] cachew.tests.test_cachew:test_many.<locals>.iter_data: loading 1000000 objects from cachew (sqlite /tmp/pytest-of-karlicos/pytest-80/test_many_gc_off_1000000_0/test_many)
test_many: reading from cache took 2.8s
```
…by about 25%

before

```
src/cachew/tests/test_cachew.py::test_many[gc_off-1000000] [INFO    2023-09-14 22:04:14,721 cachew __init__.py:796 ] cachew.tests.test_cachew:test_many.<locals>.iter_data: wrote   1000000 objects to   cachew (sqlite /tmp/pytest-of-karlicos/pytest-90/test_many_gc_off_1000000_0/test_many)
test_many: initial write to cache took 3.2s
test_many: cache size is 72.904704Mb
[INFO    2023-09-14 22:04:15,020 cachew __init__.py:660 ] cachew.tests.test_cachew:test_many.<locals>.iter_data: loading 1000000 objects from cachew (sqlite /tmp/pytest-of-karlicos/pytest-90/test_many_gc_off_1000000_0/test_many)
test_many: reading from cache took 2.8s
```

after
```
src/cachew/tests/test_cachew.py::test_many[gc_off-1000000] [INFO    2023-09-14 22:04:36,065 cachew __init__.py:796 ] cachew.tests.test_cachew:test_many.<locals>.iter_data: wrote   1000000 objects to   cachew (sqlite /tmp/pytest-of-karlicos/pytest-91/test_many_gc_off_1000000_0/test_many)
test_many: initial write to cache took 3.3s
test_many: cache size is 72.904704Mb
[INFO    2023-09-14 22:04:36,427 cachew __init__.py:660 ] cachew.tests.test_cachew:test_many.<locals>.iter_data: loading 1000000 objects from cachew (sqlite /tmp/pytest-of-karlicos/pytest-91/test_many_gc_off_1000000_0/test_many)
test_many: reading from cache took 2.2s
```
@karlicoss karlicoss merged commit a8e8525 into master Sep 14, 2023
9 checks passed
@karlicoss karlicoss deleted the updates branch September 14, 2023 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant