Skip to content

Use StringUtil.intValueOf instead of StringUtil.intValueOfOptional or custom code#10779

Merged
calixtus merged 1 commit into
mainfrom
speed-up-field-comparator
Jan 14, 2024
Merged

Use StringUtil.intValueOf instead of StringUtil.intValueOfOptional or custom code#10779
calixtus merged 1 commit into
mainfrom
speed-up-field-comparator

Conversation

@koppor

@koppor koppor commented Jan 14, 2024

Copy link
Copy Markdown
Member

While stumbling on an OpenRewrite issue (openrewrite/rewrite#3913), I found WTF code inside JabRef. We use that code for performance reasons.

Thus, I thought, let's really use it to gain performance. Here is my (first) change. In a follow-up PR, I will rewrite all Integer.parseInt to StringUtil.valueOf. This takes a bit time, since I don't know how to use refaster in OpenRewrite or how we can use error prone's refaster templates here.

Mandatory checks

  • Change in CHANGELOG.md described in a way that is understandable for the average user (if applicable)
  • Tests created for changes (if applicable)
  • Manually tested changed features in running JabRef (always required)
  • Screenshots added in PR description (for UI changes)
  • Checked developer's documentation: Is the information available and up to date? If not, I outlined it in this pull request.
  • Checked documentation: Is the information available and up to date? If not, I created an issue at https://github.com/JabRef/user-documentation/issues or, even better, I submitted a pull request to the documentation repository.

@github-actions

github-actions Bot commented Jan 14, 2024

Copy link
Copy Markdown
Contributor

The build for this PR is no longer available. Please visit https://builds.jabref.org/main/ for the latest build.

@Siedlerchr Siedlerchr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.We should get rid of our custom method for Int parsing in the long term. I doubt that it makes a hug difference nowadays and I guess the jdk standard implementation to be better optimized.
Measure not gues

@koppor

koppor commented Jan 14, 2024

Copy link
Copy Markdown
Member Author

@calixtus calixtus added this pull request to the merge queue Jan 14, 2024
Merged via the queue into main with commit 09af3ac Jan 14, 2024
@calixtus calixtus deleted the speed-up-field-comparator branch January 14, 2024 18:39
Siedlerchr added a commit that referenced this pull request Jan 15, 2024
* upstream/main:
  Bump org.apache.lucene:lucene-queries from 9.9.0 to 9.9.1 (#10795)
  Bump com.google.guava:guava from 32.1.3-jre to 33.0.0-jre (#10793)
  Bump com.dlsc.gemsfx:gemsfx from 1.90.0 to 1.92.0 (#10796)
  Bump org.mockito:mockito-core from 5.8.0 to 5.9.0 (#10794)
  Bump lycheeverse/lychee-action from 1.9.0 to 1.9.1 (#10791)
  refactor: Transform calls to `Objects.isNull(..)` and `Objects.nonNull(..)` (#10788)
  refactor: Prefer `String#formatted(Object...)` (#10787)
  refactor: Adopt `SequencedCollection` (#10786)
  Update CSL styles (#10785)
  Initial Pseudonymization (#10776)
  Use StringUtil.intValueOf instead of StringUtil.intValueOfOptional or custom code (#10779)
  Refine loading code (#10780)
  Add wokraround for theme detector issue (#10777)
  Fix enablement of Aux dialog's "Generate" button (#10775)
  Fix package of TypedBibEntry (#10774)
  Fix labeling of PRs for newcomers (#10773)
  Update add-greeting-to-issue.yml
  Update add-greeting-to-issue.yml
  Update add-greeting-to-issue.yml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants