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

Fix bulkSet #56

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Fix bulkSet #56

wants to merge 2 commits into from

Conversation

quolpr
Copy link
Contributor

@quolpr quolpr commented Jul 11, 2022

I think it may potentially fix #30

After that fix, the writing performance become slower. But we should await before all the writes finish to finish the transaction. Otherwise, the next read IDB (when you want to execute SELECT for example) will need to await when previous INSERT will finish, which is not fair for the SELECT query. And, it seems the benchmarks are wrong at the article (but not so much! The write performance is still amazing).

Also, I don't see any performance penalty of Promise.all usage — the new IDB transactions are not spawning, the overall performance at the first glance is the same.

@quolpr
Copy link
Contributor Author

quolpr commented Jul 12, 2022

Here is the example, without await and with. You can notice that without await the next select query slow down a lot (cause IDB wait write transaction to finish). And with await, the next select query is fast. And in sum, the run time for both cases is 2 secs.

example4.mp4

@quolpr
Copy link
Contributor Author

quolpr commented Jul 13, 2022

Update: this PR actually doesn't fix #30 😢 But still without awaiting the next query will be much slower, cause internally IDB don't finish writing and next read will await those writings to finish

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.

Database disk image is malformed error sometimes
1 participant