T
TanStack4w ago
cloudy-cyan

Benchmarking experimental persist plugin

The experimental_createQueryPersister seems to be slower compared to the <PersistQueryClientProvider /> one. I get that experimental_createQueryPersister restores from disk when needed, while <PersistQueryClientProvider /> restores the whole cache over RQ's in-memory cache. I am asking if there are any known methods of benchmarking the plugin. I am trying to use op-sqlite's KV storage too, so I want to rule out the possibility of the KV storage being too slow.
4 Replies
harsh-harlequin
harsh-harlequin3w ago
How can it be slower if you haven't benchmarked it 😅?
cloudy-cyan
cloudy-cyanOP3w ago
Initial observation, it "seems" slower. That's why I want to check - Difference between Provider and experimental; - Difference between persisting the experimental one to expo-sqlite compared with op-sqlite
harsh-harlequin
harsh-harlequin3w ago
I would generally assume that the experimental one should be "faster" as it doen't do anything on startup, but only when a resource is actually consumed. Of course if you mount 100 queries on page load, they would all read from their respective storage at the same time also less memory consumption compared to loading everything on startup but if you can measure it, plesae do and share the results 🙏
cloudy-cyan
cloudy-cyanOP3w ago
Yeah, I am talking more about "perceived" performance, the experimental one does nothing on startup but waits for the restore to happen when needed, which makes each individual query slower (when offline) this also depends on the read performance of the used persistence storage will look into it and report back, but I have to dig through the persist plugin's source code first, to see where I can hook some console.times

Did you find this page helpful?