Ryzen laptop shockingly slow citation update - fixed!
Hi,
I did a performance comparison in a libreoffice writer document ca. 105 pages long 285ish citations. I place a new citation after the first paragraph, prompting a refresh of all the other 285ish citations.
I should first mention that for the R5 setup (see below) I had to remove Libreoffice and re-install the "community version" from the libreoffice web site, because the parrot OS 5.2 supplied Libreoffice didn't recognize the java installation. And without Java zotero integration doesn't work. So that's one thing that's different between the systems.
All systems are running Debian linux:
i5-9600k 32gb ram: 24 seconds
i5-6300u 8gb ram: 46 seconds
R5-4650u 24gb ram: 300 seconds
I thought the i5-9600k and R5-4650u would have approximately the same single thread CPU performance so after this I ran geekbench and for single-core performance the R5 got 1515 while the i5 got 1617 points. So they do perform similarly in single-threaded work and not this more than factor 10 worse for the AMD.
I tried running the same version of Zotero (6.0.22) and Libre office (7.0.4.2) as the i5 used but no change to the performance of the R5.
The java version on the R5 is 11.0.18 and i5 has 11.0.8
Linux version of the R5 is 6.0.0.12 and for the i5 it's 5.8.0.2
I would love some suggestions on how to debug and fix this problem. I was looking forward to replacing my older Lenovo T460s with the Lenovo T14 Gen 1 AMD for a nice performance boost (in most other apps it is way faster than the T460s) but libreoffice and zotero citation is spectacularly slow.
I did a performance comparison in a libreoffice writer document ca. 105 pages long 285ish citations. I place a new citation after the first paragraph, prompting a refresh of all the other 285ish citations.
I should first mention that for the R5 setup (see below) I had to remove Libreoffice and re-install the "community version" from the libreoffice web site, because the parrot OS 5.2 supplied Libreoffice didn't recognize the java installation. And without Java zotero integration doesn't work. So that's one thing that's different between the systems.
All systems are running Debian linux:
i5-9600k 32gb ram: 24 seconds
i5-6300u 8gb ram: 46 seconds
R5-4650u 24gb ram: 300 seconds
I thought the i5-9600k and R5-4650u would have approximately the same single thread CPU performance so after this I ran geekbench and for single-core performance the R5 got 1515 while the i5 got 1617 points. So they do perform similarly in single-threaded work and not this more than factor 10 worse for the AMD.
I tried running the same version of Zotero (6.0.22) and Libre office (7.0.4.2) as the i5 used but no change to the performance of the R5.
The java version on the R5 is 11.0.18 and i5 has 11.0.8
Linux version of the R5 is 6.0.0.12 and for the i5 it's 5.8.0.2
I would love some suggestions on how to debug and fix this problem. I was looking forward to replacing my older Lenovo T460s with the Lenovo T14 Gen 1 AMD for a nice performance boost (in most other apps it is way faster than the T460s) but libreoffice and zotero citation is spectacularly slow.
You should make sure you're running current versions of LibreOffice and Java — LibreOffice 7.4 or 7.5 and Java 17 or 19.
I can switch to java version 17 by picking it in Libre office tools -> options -> libre office -> advanced.
The R5 is now running:
Version: 7.5.0.3 (X86_64) / LibreOffice Community
Build ID: c21113d003cd3efa8c53188764377a8272d9d6de
CPU threads: 12; OS: Linux 6.0; UI render: default; VCL: gtk3
Locale: da-DK (da_DK.UTF-8); UI: en-US
Calc: threaded
└──╼ $java -version
openjdk version "17.0.6" 2023-01-17
OpenJDK Runtime Environment (build 17.0.6+10-Debian-1deb11u1)
OpenJDK 64-Bit Server VM (build 17.0.6+10-Debian-1deb11u1, mixed mode, sharing)
I just did the test again and got 4 mins 42 seconds.
I'd guess this is something related to running on Parrot.
One thing I noticed is the report for the libreoffice plugin. Take item 573 for both for instance:
R5: zotero(3)([31;40m+0000776[0m): LibreOfficePlugin: Read 573 null
i5: zotero(3)(+0000117): LibreOfficePlugin: Read 573 null
What does that difference mean?
As a suggestion for troubleshooting you should try testing some more intense operations that run only in LibreOffice between the systems and compare their performance, which will allow you to figure out where the slowness originates.
When you say: "It is either the Java interface between Zotero and LibreOffice, or LibreOffice itself that is slow." could you explain how you see that in the debug log?
I did some Libreoffice tasks on both systems (opening my master .odm doc ~500 pages long ~1.300 citations) and they compare reasonably well. The R5 is 50% slower than i5 in these tasks:
Open .odm and initial refresh 10s vs 15s
Create pdf 7,7s vs 10,5s
Update all links in master doc (not citations) 15s vs 20s
It's not that bad.
I will try to approach libreoffice forums going forward. Thank you for the support :)
So the possible cause of the slowness is Java VM running in LibreOffice, LibreOffice itself and actually perhaps the TCP socket communication between LibreOffice and Zotero, although you would likely see it being slow on your Intel installations too.
Based on your tests I would not rule out LibreOffice completely, although it's not as likely to be the culprit given the relatively small difference in speed for LO operations. I can't recommend a good test for the JVM running in LibreOffice to check its performance, but perhaps LibreOffice support can. Testing the regular JRE you run yourself might not reproduce the conditions that it runs in under LibreOffice, so I wouldn't bother running tests directly on Java.
I reset the user profile in Libreoffice (link: https://ask.libreoffice.org/t/error-message/52299) and re-installed the zotero extension manually (from inside Libreoffice -> Tools -> Extension manager -> Add -> Browse to Zotero folder with the installation file).
The time for the R5 is now 55seconds.
I start sampling the CPU thread time when I start my test as described above. Same test document etc as before.
According to the profiler finishing the citation update takes the i5 5.8 seconds cpu time while the R5 takes 25 seconds. ( I wanted to upload the screendumps but I don't know how).
It's interesting that they have such a big performance difference even in the Java VM. I would expect these two processors to have approximately the same performance, i.e. maybe 20-25% difference in favor of the i5.
The Libreoffice forums didn't give me information on how to debug this. If you have some ideas I can try let me know.
Thanks in advance!
I have 25 second update for the R5! Same document etc.
What I did:
I re-installed libreoffice to the parrot distribution version. Removed all the community version stuff and got back to a working libre office from Parrot OS.
Libreoffice version:
Version: 7.0.4.2
Build ID: 00(Build:2)
CPU threads: 12; OS: Linux 6.0; UI render: default; VCL: x11
Locale: da-DK (da_DK.UTF-8); UI: en-US
Debian package version: 1:7.0.4-4+deb11u5
Calc: threaded
I then got 51 second update time.
I switched away from Java 19.0.2 to 11.0.8 and got 44 second update time.
Then the last winner was real odd - in the "Navigator" panel I collapsed the "Citations" so it did not show the list and then the result came in at 25 seconds on the R5!
I am quite happy that this update time was possible (I had my reasons to believe they were) and I wanted to report back what I found so maybe others can benefit from my findings in troubleshooting this.
It's currently unconfirmed (and I haven't figured out a way to upload a document to reproduce the problem without uploading my full thesis), so if you @Liberaletanker or someone else who has encountered the same problem could confirm it there, it might -as far as I understand LOs bug tracker - get some developers' eyes on it, hopefully.
Thanks!