JabRef / jabref

Graphical Java application for managing BibTeX and biblatex (.bib) databases
https://devdocs.jabref.org
MIT License
3.53k stars 2.47k forks source link

Performance issues with version 5.0 (example videos) #5071

Open AEgit opened 5 years ago

AEgit commented 5 years ago

JabRef 3.8.2 windows 10 10.0 amd64 Java 1.8.0_211

VS

JabRef 5.0-dev--snapshot--2019-06-20--master--6265e2460 Windows 10 10.0 amd64 Java 1.8.0_211

As announced previously (https://github.com/JabRef/jabref/issues/4430#issuecomment-504119679), here I add some videos that showcase the performance difference between JabRef 3.8.2 vs. JabRef 5.0 when working with a large database (> 18,000 entries) and several thousand static groups.

These issues have been reported previously, but I thought it would be better to create a new bug report instead of adding the videos to just one of these previous reports (they should apply to all of them, I reckon). Previous reports of issues with the performance include (among others), the following:

https://github.com/JabRef/jabref/issues/4430 https://github.com/JabRef/jabref/issues/4756 https://github.com/JabRef/jabref/issues/4526

Note, that I had to run these tests on a virtual machine, since I do not have a full license for YourKit Java Profiler and had to use a test license (since the test license I had on my actual machine is no longer valid). So the performance on an actual machine should be slightly better (the virtual machine is running on a SSD, and I assigned two cores of a Core i7 Hexacore and 8 GB of 32 GB of RAM to the virtual machine), but the relative performance difference between version 3.8.2 and version 5.0 should be comparable. In fact, my impression is that this setup favours version 5.0 because 3.8.2 appears slower in the virtual machine than in a non-virtualized setting. Version 5.0 on the other hand, is equally slow in a virtual machine and when running on the actual hardware.

Note, that I use the same database when comparing the two versions. The only difference is, that the database in version 5.0 has been saved using version 5.0 (while the other one is still using a database in 3.8.2 format). This allows for better comparison, since version 5.0 stores groups differently.

  1. Comparison of first start of JabRef: 3.8.2: https://app.box.com/s/7agrhreojpk85itl9dvsz7mx8ueaydcl 5.0: https://app.box.com/s/79dqowjer214qdi0wiceh03x9g4iuexi

Note, that version 5.0 sometimes seems to have crashed. Furthermore, I did not immediately click onto 3.8.2 when it was actually already ready.

  1. Comparison of JabRef search feature: 3.8.2: https://app.box.com/s/fgr84sgpsz6dscbnku91m5o2hhbf6rwt 5.0: https://app.box.com/s/fxwcska8dm5rlilv6a9mqswelkrqkh0t

  2. Comparison of working with JabRef groups: 3.8.2: https://app.box.com/s/fc5ku29f39o9r7h86hj309tao4uifo8o 5.0: https://app.box.com/s/cubdi2vvmzjnj5i7rtn57lfxp24kvzb9

Note, how JabRef freezes several times in version 5.0 when using certain groups features (e.g., assigning an item to a group, assigning a group as a new subgroup, ....). Sometimes it appears as if nothing is happening in the video, but it is actually just JabRef freezing from time to time. Note, the big differences in the time that JabRef spents on some actions (see YourKit Java Profiler). For certain actions, JabRef 5.0 will take much much longer than 3.8.2 (which translates into higher CPU demands).

buhtz commented 5 years ago

5156

tobiasdiez commented 4 years ago

@AEgit the most recent developement version now includes the latest performance improvements. Could you please check what still needs improvement. Thanks!

AEgit commented 4 years ago

@tobiasdiez Due to the issues with the current Windows installer (see https://github.com/JabRef/jabref/issues/5580#issue-520403252) and since the snap package on Linux also does not seem to work yet (see https://github.com/JabRef/jabref/issues/5417) I cannot test the current developer version, I am afraid.

LyzardKing commented 4 years ago

The snap can be installed from https://builds.jabref.org/master/ It won't auto update and you need to install with --dangerous (since it's not from the store) But for testing it can be done.

AEgit commented 4 years ago

JabRef 5.0.0-dev--2019-11-17----151a216a2 Windows 10 10.0 amd64 Java 13.0.1

@tobiasdiez Tried the current dev version. This one is much improved in terms of performance. Switching between different groups and articles is now much smoother. Well done!

The following performance issues remain:

  1. Assigning an item to a group has a heavy impact on the CPU. Now, if you assign just a single item, this appears to be no major isse for a user with a powerful machine. I have a 6-core i7 and while the assignment of a single item brings the CPU usage to nearly 50% for a few seconds, the item appears (?) to be assigned immediately to this group (this might already be a problem, though, for people with weaker machines). What is a problem, however, is when you try to assign multiple items simultaneously to a new group. The CPU usage shoots up and (depending on how many items you try to assign to the group) JabRef freezes for some time. The CPU usage also stays high for a protracted time period: I am not sure, whether the items have already been assigned to the group as indicated by the item counter since the CPU usage stays high even after that for quite some time. To recreate this problem, try the following: a) Select multiple items in the main table b) Drag'n'drop them onto a group they had not be assigned to c) Observe the mentioned issues
  2. The same problem arises when you try to assign groups as subgroups of other groups (in fact, I think this feature might be bugged, but I have to test this more thoroughly). If you assign just a single group, things appear fine. But if you assign multiple groups simultaneously as subgroups to a new group (again, by using the drag'n'drop feature - but this time in the groups panel), you end up with a high CPU usage over a protracted period of time.
  3. When you select multiple groups in the groups panel simultaneously (using left click on the starting group and left click + SHIFT on the ending group), there is a noticeable delay until all groups are selected and the CPU usage shoots up again.
  4. There is a noticeable delay (a few seconds) when you select the "All entries" group until the respective items are shown in the main table. I reckon this is directly dependent on the number of entries assigned to a certain group, because this problem also appears to arise, when groups with a high entry count are selected (currently my "All entries" group contains nearly 20,000 items).

These are the performance issues I have observed so far. Nevertheless, again a big thanks to @tobiasdiez for the major performance improvements that the current version offers now - this is definitely a major step into the right direction.

tobiasdiez commented 4 years ago

Thanks for the feedback. I'll try to have a look at the remaining performance issues in the next days.

AEgit commented 4 years ago

JabRef 5.0.0-dev--2019-11-24----8780a5632 Windows 10 10.0 amd64 Java 13.0.1

Note also, that it appears, as if the search has become slower again. Not as bad as it was in the past (https://github.com/JabRef/jabref/issues/2852), but it seems, that the latest versions have seen a performance decrease there as well. Entering a search term using a large database results in lagged input (similar to a low frame rate in a video game).

Siedlerchr commented 4 years ago

@tobiasdiez related to the add tab threading?

tobiasdiez commented 4 years ago

@AEgit We implemented some performance improvements recently. Can you please see if they might have fixed some of the issues you described in https://github.com/JabRef/jabref/issues/5071#issuecomment-554769666. Moreover, it would be good which of the remaining issues are critical, i.e. need to be fixed before we release 5.0. Thanks

AEgit commented 4 years ago

JabRef 5.0-beta.354--2020-01-18--2612e22 Windows 10 10.0 amd64 Java 13.0.2

The new versions brings some improvements, but the problems are still too big for a release version. I will explain this in detail below (based on the issues reported in https://github.com/JabRef/jabref/issues/5071#issuecomment-554769666):

  1. Now, if you assign multiple items to a single group, JabRef still has a high CPU usage (60%) over a protracted period of time (several minutes!), but it does not freeze anymore. However, now another issue can be observed. Namely, the cycling through entry previews does not work while the CPU usage is high. When you try to go from an entry preview of one item to the next one, the next item will be selected in the main table (indicated by the blue marking), but the corresponding entry preview is not shown. Instead, the entry preview of the previously selected item is shown. This means, that for several minutes (until the CPU usage has dropped from the item assignment to a new group) it is NOT possible to see the entry previews of all entries (except for the one, that had been selected initially). I think this is a major problem, that needs to be fixed before release.
  2. The problem with high CPU usage over time, if you assign a group as a subgroup of another still persists and appears to be even worse than before. I have just tried to assign one group as subgroup of another and that assigned another group as the subgroup of the previous one, i. e. we end up with a 3-leveled order: group - subgroup - sub-subgroup In total, just two groups have been moved. Despite that, the CPU usage stayed high for several minutes (!). It might be, though, that this problem only appears, if issue 1 has been triggered first, since I have not been able to trigger this behaviour consistently.
  3. Issue 3 appears to be fixed.
  4. The delay mentioned in issue 4 has been much reduced (it is now less than a second, as far as I can tell).
  5. When you now make changes to group structure (e.g., assign two groups as the subgroup of another group) and then selected another group again, NO items at all are shown in the main table. This means, that a few changed to the group structure lead to a non-functional main table (it just remains empty).
  6. The slowed down search persists (see https://github.com/JabRef/jabref/issues/5071#issuecomment-557923718).

I wonder whether some of these performance issues could be solved by a simple workaround: Make it possible to switch off the calculation of the number of items in the groups. In version 3.8.2 this was possible and was also suggested to do, when having performance problems. Indeed, I switched it off for my database, since otherwise it would not be possible to work with the database due to performance problems. However, you shouldn't get rid of the background box surrounding the group item account. This box changes colour according to whether an item selected in the main table is part of a group or not, so this information should be available. In the old JabRef version this was achieved by having the name of a group underlined, which contained a selected item.

ilippert commented 4 years ago

I have 10500ish entries; simply sorting the entry table by a column, e.g. title, takes typically several seconds.

JabRef 5.0--2020-03-08--93de138 Linux 5.5.7-200.fc31.x86_64 amd64 Java 13.0.2

Siedlerchr commented 4 years ago

Could you all please test with the latest development version? We upgraded to javafx14 which comes with an overall performance improvement. We still have to optimize some bottlenecks, but I personally noticed some performance increases

AEgit commented 4 years ago

JabRef 5.1--2020-03-18--99183e1 Windows 10 10.0 amd64 Java 13.0.2

I am afraid, as mentioned previously (https://github.com/JabRef/jabref/issues/5510#issuecomment-590564792; https://github.com/JabRef/jabref/issues/5735#issuecomment-591904187), the performance is actually worse for me - it is so bad, that I cannot use my large database any more for bug testing.

ilippert commented 4 years ago

JabRef 5.1--2020-03-18--99183e1 Linux 5.5.8-200.fc31.x86_64 amd64 Java 13.0.2

with approx 10600 entries

in the entry table, when I sort according to a column, the first time I click onto a column header, it can take 15-20 seconds to sort the entries. the second time, sorting in the opposite order, takes only a 3 seconds.

koppor commented 4 years ago

Side comment: For sharing screen recordings, loom was recommended to me. Then, everyone with a web browser can see the videos. (I got comments that some users could not see the videos above)

koppor commented 4 years ago

I would assume that this issue also covers search-as-you-type, where @hankstevens01 and @lc9275 reported that it is very slow:

Thus, I just list it here.

tobiasdiez commented 4 years ago

I found some Easter eggs in the code. After eating them JabRef now feels more slim and responsive. In fact, for me all the performance problems mentioned in this issue are fixed now.

@AEgit @ilippert @Codeberg-AsGithubAlternative-buhtz Could you please check the build from http://builds.jabref.org/master/. Thanks! Please remember to make a backup of your library before trying-out this version.

LyzardKing commented 4 years ago

@koppor @tobiasdiez Is the snap --edge channel now updated on every commit to master?

ilippert commented 4 years ago

JabRef 5.1--2020-04-10--d4396ce Linux 5.5.15-200.fc31.x86_64 amd64 Java 14

thanks for the note! this is my experience:

hankstevens01 commented 4 years ago

JabRef 5.1--2020-04-10--d4396ce Mac OS X 10.15.4 x86_64 Java 14

Database of 19800 refs

On Sun, Apr 12, 2020 at 10:09 AM Ingmar Lippert notifications@github.com wrote:

JabRef 5.1--2020-04-10--d4396ce Linux 5.5.15-200.fc31.x86_64 amd64 Java 14

thanks for the note! this is my experience:

  • sorting my 10600 entry file by title still takes 30 seconds (should be a basic entry table operation).
  • after running jabref for about 2 minutes, jabref often hangs, being unresponsive.
  • after running for 8 minutes, jabref has memory 1.7gb, virtual memory 91,2 gb, resident memory 1,8gb, shared memory 128mb

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/JabRef/jabref/issues/5071#issuecomment-612620760, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAVZLPEM7Q2WXNO3VXZKKF3RMHDSDANCNFSM4H2ZP5UA .

--

“Life is a garden, not a road. We enter and exit through the same gate. Wandering, where we go matters less than what we notice.” Dr. Hank Stevens Pronouns: he/his

Director, Ph.D. Program in Ecology, Evolution, and Environmental Biology https://miamioh.edu/cas/academics/programs/eeeb/

Associate Professor (lab website https://blogs.miamioh.edu/stevens-lab/)

Miami University | Department of Biology

433 Hughes Hall

Oxford, OH 45056 O: 513-529-4206 | Hank.Stevens@MiamiOH.edu https://miamioh.edu//miami-tribe-relations/index.html Learn more about Miami Tribe Relations https://miamioh.edu//miami-tribe-relations/index.html

Siedlerchr commented 4 years ago

Sorry, the build has failed to upload the files. Please test the version from the run: https://github.com/JabRef/jabref/runs/580559222 (Top right corner, "Artifacts") (Unfortunately the github build system puts all versions for one os together in one archive)

ilippert commented 4 years ago

sorry, I am not sure what you mean - I cannot find Artifacts at the linked page. I can find some at https://github.com/JabRef/jabref/actions/runs/76469953 - do you mean those?

Siedlerchr commented 4 years ago

@ilippert Yes, sorry, I had apparently linked the wrong run.

ilippert commented 4 years ago

Sorry to disappoint ... first attempt to run

buhtz commented 4 years ago

"easter egg"? Can you please link the commit where it was removed? Does the "easter egg" will have any consequences for some persons and/or for the quality control process in the JabRef development?

Starting JabRef still cost to much time. But the issue with text entry is ok - for now.

koppor commented 4 years ago

@Codeberg-AsGithubAlternative-buhtz please don't take the word "easter egg" literally. It was meant as issue I the JabRef code. We are working hard to get students on board at JabRef development. See https://devdocs.jabref.org/teaching for details. At the linked page https://devdocs.jabref.org/getting-into-the-code/development-strategy you see that we take quality serious. Please don't fear that we "play around" with JabRef.

AEgit commented 4 years ago

JabRef 5.1--2020-04-12--771af5d Windows 10 10.0 amd64 Java 14

@tobiasdiez : Thank you very much! This is, indeed, a nice "easter egg". Many of the previous performance issues have now either disappeared or are much less pronounced, than they were before.

I will list here the issues that appear to remain, mainly based on comment https://github.com/JabRef/jabref/issues/5071#issuecomment-575912921:

  1. Has basically disappeared. If you assign multiple items to a group, CPU usage might shoot up, but it will only be for a few sec.
  2. Has disappeared if you only assign small groups (i. e. containing a few subgroups/items). If you re-assign large groups (with thousands of subgroups/items) as a new subgroup to another group, the problem persists (but is less prominent than it was before). If such a large group is re-assigned CPU usage shoots up for 10 to 30 sec. The cycling through entry previews does not work while the CPU usage is high. When you try to go from an entry preview of one item to the next one, the next item will be selected in the main table (indicated by the blue marking), but the corresponding entry preview is not shown. Instead, the entry preview of the previously selected item is shown. This means, that for up to 30 sec (until the CPU usage has dropped from the item assignment to a new group - depending on the size of the group) it is NOT possible to see the entry previews of all entries (except for the one, that had been selected initially). Is this something that can be improved? It is now much better than it was before (with several minutes of waiting time even for small groups), but maybe it can be improved even more?
  3. Issue 3 is fixed, as mentioned previously.
  4. The delay mentioned in issue 4 (when selecting "All entries") is still less than a second (so people might be ok with it).
  5. Issue 5 sometimes appears, but I have not managed so far to create a reproducible example.
  6. The search is fast again for me (after having conducted the first search).

Additionally:

  1. Opening JabRef the first time takes about 30 sec with my large database. During that time there is a high CPU load, but after that JabRef is quite responsive.
  2. Turning off the item count in the groups panel increases performance (though not as much, as I expected).
  3. Opening an old JabRef database (e.g., one form version 3.8.2) takes longer than opening a database that has been stored in v. 5 format. But it is by far not as bad, as it was in the past (https://github.com/JabRef/jabref/issues/5735#issuecomment-564566440). Similarly, opening an older database also requires more RAM (same database in 3.8.2 vs. 5.1: ca. 3.5 GB vs. ca. 2 GB).

These changes are a major step forward! Well done. I reckon once these minor issues are solved and when the floating mode is re-implemented (https://github.com/JabRef/jabref/issues/4237) I can finally move from version 3.8.2 to version 5.1 for my working environment.

tobiasdiez commented 4 years ago

@ilippert @AEgit thanks for the feedback.

ilippert commented 4 years ago

Not sure whether to report this here, or as a new bug. I just deleted about 2000 entries from my 10600 entry database. It took about 4 minutes to complete this operation, meanwhile jabref was not useable.

JabRef 5.1--2020-05-04--7bb1e24 Linux 5.6.8-200.fc31.x86_64 amd64 Java 14.0.1

AEgit commented 4 years ago

JabRef 5.1--2020-05-04--b5599c9 Windows 10 10.0 amd64 Java 14.0.1

Can confirm the issue reported by @ilippert (https://github.com/JabRef/jabref/issues/5071#issuecomment-624058022). I just tried to delete >7,000 entries from a database with >20,000 entries. It took several minutes during which JabRef was not responsive so ultimately I decided to force shutdown JabRef since it seem to take way too long.

ilippert commented 4 years ago

Let me add another performance report: I copied the 10500 entries of my database (the message of having copied the entries came after about 1.2 seconds, fine)). Pasting it into a new empty file took about 9 minutes. meanwhile, jabref was not usable.

ilippert commented 4 years ago

I have now disabled the timestamp and repeated the operation of creating an entirely new database. copying and pasting the >10500 entries was much swifter: 23-26 seconds.

ilippert commented 4 years ago

Just to ask those who are part of this conversation: does anybody of you also experience that jabref does not cleanly shut down and uses high amounts of CPU? I noted that about a week ago ... https://github.com/JabRef/jabref/issues/6559

AEgit commented 4 years ago

@ilippert : I have not come across this issue, but I should also mention, that: a) I usually run JabRef on Windows (rarely on Linux) b) I do not use the current dev version 5.1 in a productive environment, but version 3.8.2 (I cannot switch before the following feature request is implemented: https://github.com/JabRef/jabref/issues/4237). So I am only testing version 5.1 for a short period of time. I don't know whether this contributes to the fact that I cannot reproduce the behaviour that you describe.

m-mauersberger commented 3 years ago

Performance issues persist for me when using a large database (~5000 entries) as well: database operations take ~5-10s. I want to use it as shared DB but the problem is the same for local and shared databases (see also #4461). Even if no changes are present, reloading of (shared) database takes the same time!

Maybe it has something to do with the EventBus? Just as a quick idea: Can it be the reason for slow down that each entry has its own EventBus and the listening methods are "overcharged"?

ilippert commented 3 years ago

Recent versions of JabRef have worked well for me. but JabRef 5.3--2021-01-07--129abaa Linux 5.9.16-200.fc33.x86_64 amd64 Java 15.0.1

seems very slowly reacting (takes several seconds to switch between entries in entry table). Although the use of the system's resources is fine.

ilippert commented 3 years ago

Recent versions of JabRef have worked well for me. but JabRef 5.3--2021-01-07--129abaa Linux 5.9.16-200.fc33.x86_64 amd64 Java 15.0.1

seems very slowly reacting (takes several seconds to switch between entries in entry table). Although the use of the system's resources is fine.

Ok, today under JabRef 5.3--2021-01-07--aef49f4 Linux 5.9.16-200.fc33.x86_64 amd64 Java 15.0.1 JavaFX 15.0.1+1 it works well again ;)

ilippert commented 3 years ago

JabRef 5.3--2021-01-24--ae43548 Linux 5.10.9-201.fc33.x86_64 amd64 Java 15.0.2 JavaFX 15.0.1+1

When starting up, JabRef needs 60-70% of CPU. It then goes down to 0% If I don't do anything. When selecting an entry it goes up to 2-3%. Switching a library goes up to 7%. Well, this might be normal operations. Adding a few lines in some entries. And then CPU use goes up to 60, 70, >80%! Closing JabRef then does not stop the process.

tobiasdiez commented 3 years ago

Thanks for the report. Do you remember the last version were you didn't experienced these problem?

ilippert commented 3 years ago

Thanks for the report. Do you remember the last version were you didn't experienced these problem?

Unfortunately, not exactly. If it helps, I would say last week. (If there was a repository with all the last 2 week's master builds, I would be happy to test these; but I don't think this exists.)

ilippert commented 3 years ago

JabRef 5.3--2021-03-15--b068ce7 Linux 5.10.22-200.fc33.x86_64 amd64 Java 15.0.2 JavaFX 16+8

have not done anything with JabRef for a few minutes, and it uses 50% of CPU. happens regularly that JabRef uses up to 100% and then crashes.

ilippert commented 3 years ago

JabRef 5.3--2021-03-19--049acb9 Linux 5.11.7-200.fc33.x86_64 amd64 Java 15.0.2 JavaFX 16+8

I am sorry to say that JabRef over the last versions reliably crashes and often crashes the system, requiring a cold restart of the computer.

Ali96kz commented 3 years ago

@ilippert could you provide your .bib file? I will try to investigate it

Ali96kz commented 3 years ago

Could we test it with that fix #7486

ilippert commented 3 years ago

JabRef 5.3--2021-03-29--2948e6d Linux 5.11.10-200.fc33.x86_64 amd64 Java 15.0.2 JavaFX 16+8

Over the last two days I experienced no issues.

Ali96kz commented 3 years ago

@AEgit Could you test it with that fix #7486, please don't forget to make backups

AEgit commented 3 years ago

JabRef 5.3--2021-03-29--2948e6d Windows 10 10.0 amd64 Java 14.0.2 JavaFX 16+8

The issue mentioned in https://github.com/JabRef/jabref/issues/5071#issuecomment-624073216 persists.

ilippert commented 2 years ago

JabRef 5.7--2022-06-12--e3b2ab2 Linux 5.17.13-300.fc36.x86_64 amd64 Java 18.0.1 JavaFX unknown

I am quite happy with the performance, however,

ThiloteE commented 2 years ago

meta-issue: #8906

ThiloteE commented 2 years ago

JabRef 5.7--2022-06-15--cb5fe60 Linux 5.4.0-120-generic amd64 Java 18.0.1 JavaFX unknown

Tried to reproduce https://github.com/JabRef/jabref/issues/5071#issuecomment-624073216

Took me ca. 1-4 minutes to even select 7360 entries from my 100 000 entries database (15,5 mb) with Shift+PageUp. This was a lot faster than Shift+Up by the way. I don't want to know how long it will take to select 7000 entries with CTRL+Shift+Up....

Then i tried to delete 7360 entries: Used my stop watch to count: 1 hour, 37 minutes ... + X. Did a force close, because I don't want this PC to run at max capacity for hours. Just to delete a simple text in a text-file this seems a little bit over the top.

CPU was pretty high. RAM was normal and stable. grafik

This was done with an old laptop from 2013: Aspire E13 (ES1-311-P87D), the HDD was replaced with a SSD at one point. The CPU is a Intel Pentium N3540, which is designed for long battery life and consequently has weak benchmarking results: https://www.cpubenchmark.net/cpu.php?cpu=Intel+Pentium+N3540+%40+2.16GHz&id=2408