[Zotero 7 Beta] High CPU usage
Since the last update, I have noticed high CPU usage (around 15%). It occurs without any specific action being taken. I have the following plugins installed: Better BibTex; Translate for Zotero; Zotero Attanger.
I'm running Ubuntu 24.04 and Zotero 7.0.0-beta.91+3c6625f3c (64-bit).
Debug ID: D272073557.
Thank you for your impressive work.
I'm running Ubuntu 24.04 and Zotero 7.0.0-beta.91+3c6625f3c (64-bit).
Debug ID: D272073557.
Thank you for your impressive work.
For issues with plugins, please report to their owners.
Is the idea that this was slow because it was the first export being generated (or maybe there were many new/modified items, or the citekey had changed, or…)? How long does a regular auto-export take for a large library, once entries have been cached?
Sure, that shouldn’t be hard. Is there something in the UI
(preferably available in Zotero 6 and 7) that I can reuse for this
purpose?
That’s part of it; part is also that the serialized items in the
current release always need to be transported to the worker for each
export, which takes a surprising amount of time. This I have solved
already on a development build; the cached entries also need to be
similarly transported to and from the worker, I’m working removing main
thread interaction there entirely. This will improve both performance
and memory use.
I’ll be running new performance tests when I have the cache overhaul
done, the last measured state of affairs is at
https://retorque.re/zotero-better-bibtex/support/performance/index.html.
I have a 24k items test in my test suite that's currently broken, I’ll revive that for the
tests.
Depending on where you're planning to keep your cache in your new system and how long it takes to shuttle data around, just doing a couple straight reads of the existing file might be faster.
native: 5.7s, raises load from idle to ~96% (on the foreground thread)
bbt, uncached: 43s, raises load from idle to ~112% (in a worker thread)
bbt, cached: 5.6s, raises load from idle to ~101% (in a worker thread)
this is just from a few runs, not scientific tests, but this looks promising to me, and if you're exporting 24k items on the regular, you can't really complain about these numbers.
A more sensible 86-item export takes 0.3s uncached, 0.06s cached.
Still needs more testing, and I'm pretty sure I can shave time off the cached export.
Do people tend to turn this on for entire libraries or for specific collections? Trying to understand whether 86 items or 24K is more representative, or if something like the size of a standard library — somewhere between those numbers — would be more representative.
My concern is entirely about auto-exports creating load (with battery usage, heat, etc.) on every item change and then blaming Zotero for being slow.
I don't have telemetry to see how many/how large auto-exports users have set up, but the 24k library is way out of the ordinary, and for me is only useful as a stress-test. The 24k uncached library export went from 400 seconds to 43 seconds BTW, mostly because the source items no longer need to be transferred to the worker for every export. The new design will also use substantially less memory for large libraries.
I'm open to warning users about large auto-exports, even persistent warnings, or curtailing auto-export behavior; I could see enforcing on-idle exports after a certain threshold on number of items or export time, or dynamically pushing back the default debounce delay to something like double the longest export to date. But with the work happening on a worker thread, with the main thread now only communicating what item IDs to export, Zotero wouldn't really slow down, although of course the battery usage/heat concern stands.
I don't see the point of auto-exporting a 24k item bib file, really, but there is at least one user that does; it is how I got the sample library. But his is extreme, and I had to make changes to my test infra to even be able to load the database (before starting the actual tests).
I'm still looking at the CSL JSON export -- that takes 2.5s (against 3s stock), but I had expected it to come out roughly the same as the TeX exports on a warm cache -- the cache handling is uniform over them.
Zotero 7 is much faster than 6, there it works out to 1.8s vs 6s for TeX, and 3.9s vs 6.3s for CSL.