-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Entry Editor extremely slow with shared database on remote MySQL server #3736
Comments
Could you please try with JabRef 3.8.2 and report back whether it is equally slow? |
Regarding the frequency of the synchronization with the database, the following should be the case:
Is this, roughly, your user experience? The key point is step 3. |
@koppor I tried 3.8.2 and with this version, the problem does not occur. The Entry Editor takes a little bit more time to load, and changing fields (with tab key or mouse) is somewhat laggy, but typing is OK, even with autocompletion. All in all, usable. @lenhard No, that is not my experience with version 4.x. At step 3 the situation does not change. Every character lags for about 1,5 seconds. Curiously enough, with 4.x, the Editor pops up faster, and changing fields is responsive as well. |
@memering Thank you very much for investigating this! Unfortunately that is not the behavior I expect from looking at the code. But it seems that something somewhere is triggering an entire save operation for every character change that (my guess) does a complete overwrite of the database schema. Before 4.0, there were much less updates in JabRef and probably the database code did not become aware of every character change in the database. That's why the situation is different with 3.8.2. It is really unfortunate that the people who wrote all this seem to have vanished... |
What about putting the changes in a queue and let a different thread consume that and send it to the database. |
This is NOT the case here. The MySQL server does not support pub/sub. So, the changes are sent if the SYNC button is pushed (if I recall correctly). It is not properly documented at http://help.jabref.org/en/SQLDatabase, but it was implemented like that by @obraliar for JabRef 3.6. I don't know what was changed until then. Only PostgreSQL and Oracle have pub/sub, where changes are pushed and pulled without the need of the sync button. |
The changes are pushed on every Unfortunately I'm too busy right now to fix this problem. I think this will get changed in a month or two, where I'm going to rework this module. |
@obraliar Thank you for the insights. Maybe, we can quickfix by introducing another event with |
Didn't @lenhard introduce the Coarse Change Event Listener for the change scanner? |
Does anybody know where UI listener of the entryeditor are organized? |
There are no longer event listeners on the text fields in the entry editor. The contents of the text field is automatically synced to the entry, which then posts the change event. All listeners are thus registered on the entry (or on the database). For the autosave/backup, the CoarseChangeFilter filters out minor changes so that a save is not triggered upon every key press. It seems to me, however, this filter is not installed in front of the SQL database sync. |
It actually is:
But for some reason
is executed three times (!) on every key press. I think this not the desired behaviour, since it leads DBMSSynchronizer to synchronize the same change multiple times.
|
The code of the Something that comes to my mind: Is the source tab somehow playing ping pong with other components? |
Its not only related to the sharedatabase, it happens even if you simply type one char
|
I debugged this whole stuff and still can not figure out where exactly this change is coming from. It's definitely coming from the UI. So there must be some bindings which fire each other again. |
I just tried it in the maintable-beta branch and there the |
I have just posted here what DB commands are executed on a PostgreSQL server in various situations. See in particular the test cases when typing 1 and 10 characters in the Title field. It appears that for each character, the field is updated only once, but many other extra statements are executed, and some of these appear several times. |
Thank you for reporting this issue. We think, that is already fixed in our development version and consequently the change will be included in the next release. We would like to ask you to use a development build from https://builds.jabref.org/master and report back if it works for you. Please remember to make a backup of your library before trying-out this version. |
JabRef 4.1 or
JabRef 4.2-dev--snapshot--2018-02-16--master--bb2b07833
Linux 3.13.0-141-generic amd64
Java 1.8.0_162
Steps to reproduce:
Notes:
The text was updated successfully, but these errors were encountered: