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

Iterating over URIs in json_file db is slow #74

Open
thorbjoernl opened this issue Aug 20, 2024 · 0 comments
Open

Iterating over URIs in json_file db is slow #74

thorbjoernl opened this issue Aug 20, 2024 · 0 comments

Comments

@thorbjoernl
Copy link
Collaborator

Iterating over the URIs in a json database is currently extremely slow. The following quick benchmark illustrates the problem when iterating over the included test dataset which consists of only 39 objects.

import aerovaldb
import time

with aerovaldb.open("json_files:./tests/test-db/json") as db:
    start_time = time.perf_counter()
    count = len(list(db.list_all()))
    end_time = time.perf_counter()

print(f"json_files: {count} items in {end_time-start_time:.3f} seconds")

with aerovaldb.open("sqlitedb:./tests/test-db/sqlite/test.sqlite") as db:
    start_time = time.perf_counter()
    count = len(list(db.list_all()))
    end_time = time.perf_counter()

print(f"sqlite:     {count} items in {end_time-start_time:.3f} seconds")

# Output
# json_files: 39 items in 0.197 seconds
# sqlite:     39 items in 0.001 seconds
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant