Skip to content

Is there a performance penalty for creating new Dexie instances on every use? #1656

Answered by dfahlander
VapidLinus asked this question in Q&A
Discussion options

You must be logged in to vote

I advice you to prioritize improving it as soon as possible because each Dexie will spend some time opening the database. Also, this might leak resources and memory as databases aren't properly closed.

Suggesion would be to have a static Map between customerId and Dexie instances, a helper function to get a Dexie instance based on customerId, that get it from that cache instead of creating a new Dexie each time.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@VapidLinus
Comment options

Answer selected by VapidLinus
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants