Replies: 1 comment 3 replies
-
When you hit the very first request, dexie will take the chance to open the database in the background which will add time to the measuring. To avoiding measuring the time it takes to open the database, make sure the database is already opened. You could add this line before if (!db.isOpen()) await db.open(); |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I am using MSW to mock requests performed by application. I added Dexie to this setup in order to simulate behaviour of real API (ability to create entities and then fetch them and much more).
I would like to measure time that Dexie adds up to my handlers and I'm not sure if this is the right way of doing it. I would appreciate suggestions how to correctly measure timings of operations on the DB.
Example handler and how I attempt to measure time:
I measured all handlers in this way. Result is that when my application starts, some handlers take 700-900ms to execute (measured by above method) and this is worries me as those handlers are very often just taking all entities from the table and returning them (it's mostly just few objects).
I would like to understand if Dexie is slowing down my handlers.
Beta Was this translation helpful? Give feedback.
All reactions