-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Optimize saving #7568
Optimize saving #7568
Conversation
Now this is not a good idea, you are effectively switching back to the legacy api 👎 |
@Siedlerchr DateTimeFormatter throw a lot of exception, that's why it leads to OOM. Regex validation is too complicated and will less efficiently than these solution |
The same problem is here #6057 |
Hi @Ali96kz , first of all, thanks for your interest in JabRef and the issue triangulation. Since you found the most probable source of the issue, we can think about a fix. Secondly, I have to agree with @Siedlerchr that switching back to the old 1.1 Java DateTime API seems not to be an option (see here: https://www.oracle.com/technical-resources/articles/java/jf14-date-time.html ). The question is, is there any way to avoid the expensive operations or to cache the pattern etc. |
Btw. the tests and checkstyle are failing. |
I will investigate possible solutions |
I found some resources to work with the DateTimeFormatter and DateTimeFormatterBuilder, which can probably reduce the cost. This may be especially interesting: Like something here:
Does not yet completely remove the costly stacktrace creation, but provides at least a unified parser for all the patterns. |
Hi @Ali96kz , i took the liberty to push a commit on your branch with a little proposal for a first step towards a solution. You already moved the creation of the patterncompiler out of the parse method, so there should already be an enhancement in speed (even though still a lot of exceptions are probably thrown). However, i hope the new unified DateTimeFormatter, created from the DateTimeFormatterBuilder can enhance the speed a bit more. If you don't like my changes, you can always force-push over them. |
@calixtus I think it solves our problem because the number of exception should not be too much |
Thanks for your start @Ali96kz end especially for the part about the early creation of patterns. Let's hope that this speeds up the parsing of Dates. |
* upstream/main: (25 commits) Fix NumberFormatException in BracketedPattern (#7600) Update MAINTAINERS (#7601) Fix CSL update (#7592) Add unit tests for org.jabref.gui classes (#7579) Squashed 'buildres/csl/csl-styles/' changes from 30fb68e..e1acabe Bump tika-core from 1.25 to 1.26 (#7589) Revert "Skip Mac OS build if secret not present (#7591)" (#7594) Optimize saving (#7568) Skip Mac OS build if secret not present (#7591) Rename master to main in dev help Update tests-fetchers.yml Update refresh-journal-lists.yml Update deployment.yml Rename master to main in coding readme Rename master to main in citation style update Rename master to main in gitversion config Fix column sort order gets overwritten (#7573) Add some hints on test tooling (#7585) Add "Update Gradle Wrapper Action" (#7584) Bump classgraph from 4.8.102 to 4.8.104 (#7587) ...
#7265 Changed to simpleDateFormatter it doesn't throw a lot of exception
CHANGELOG.md
described in a way that is understandable for the average user (if applicable)