Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Merge requests
  • !10496

Optimize: entrySet is faster than keySet + get to prevent N lookups

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Administrator requested to merge github/fork/larrydiamond/master into master Sep 29, 2021
  • Overview 0
  • Commits 4
  • Pipelines 0
  • Changes 16

Created by: larrydiamond

This is a series of minor performance boost by replacing the keySet + get calls with entrySet in order to eliminate N lookups in a few places.

In addition, some TreeMap/Set objects were replaced with ConcurrentSkipListMap/Set types which are generally faster and intended to be a replacement when introduced with Java 1.6. https://www.javacodegeeks.com/2017/04/simple-map-iterator-performance-test.html for some nice charts of the performance differences.

I ran all of the unit tests, and I was a little surprised to see pre-existing PMD issues. I did not add any new ones but there are existing ones.

I did review and follow the contribution guidelines and ran the samples. There were no file changes as a result of running the samples, which did not surprise me as this is a performance improvement only - there should be no changes in any output and there was not.

This contribution is against master, please let me know if I did this against the right branch or if I should be doing this work against a different branch.

This is my first pull request to openapi-generator, please excuse any expected actions I did not perform prior to sending this pull request, I will gladly make any changes to fulfill the process to commit code.

Thank you very much, Larry Diamond

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/larrydiamond/master