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
DATACMNS-1366 - Performance optimizations. #305
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Use HashMap and Weak references to improve memory and CPU profile. After the change: Benchmark Mode Cnt Score Error Units TypicalEntityReaderBenchmark.kotlinDataClass thrpt 10 6854944,543 ± 42529,071 ops/s TypicalEntityReaderBenchmark.kotlinDataClassWithDefaulting thrpt 10 2793714,016 ± 98796,277 ops/s TypicalEntityReaderBenchmark.simpleEntityConstructorArgsCreation thrpt 10 4439036,009 ± 30217,601 ops/s TypicalEntityReaderBenchmark.simpleEntityGeneratedFieldAccess thrpt 10 8271521,172 ± 36635,054 ops/s TypicalEntityReaderBenchmark.simpleEntityGeneratedPropertyAccess thrpt 10 7697887,405 ± 249506,083 ops/s TypicalEntityReaderBenchmark.simpleEntityReflectivePropertyAccess thrpt 10 7909853,463 ± 66718,892 ops/s TypicalEntityReaderBenchmark.simpleEntityReflectivePropertyAccessWithCustomConversionRegistry thrpt 10 7183844,376 ± 98420,044 ops/s
…tentEntity.iterator(). After the change: Benchmark Mode Cnt Score Error Units TypicalEntityReaderBenchmark.kotlinDataClass thrpt 10 6825203,167 ± 164389,990 ops/s TypicalEntityReaderBenchmark.kotlinDataClassWithDefaulting thrpt 10 2901606,524 ± 17283,276 ops/s TypicalEntityReaderBenchmark.simpleEntityConstructorArgsCreation thrpt 10 4819899,390 ± 18690,841 ops/s TypicalEntityReaderBenchmark.simpleEntityGeneratedFieldAccess thrpt 10 8621389,713 ± 52273,537 ops/s TypicalEntityReaderBenchmark.simpleEntityGeneratedPropertyAccess thrpt 10 9447210,484 ± 63331,428 ops/s TypicalEntityReaderBenchmark.simpleEntityReflectivePropertyAccess thrpt 10 8533150,231 ± 56215,975 ops/s TypicalEntityReaderBenchmark.simpleEntityReflectivePropertyAccessWithCustomConversionRegistry thrpt 10 6872518,604 ± 74019,461 ops/s
…d Reference. After the change: Benchmark Mode Cnt Score Error Units TypicalEntityReaderBenchmark.kotlinDataClass thrpt 10 6676400,185 ± 45164,682 ops/s TypicalEntityReaderBenchmark.kotlinDataClassWithDefaulting thrpt 10 2981338,468 ± 36943,754 ops/s TypicalEntityReaderBenchmark.simpleEntityConstructorArgsCreation thrpt 10 4445213,022 ± 73618,043 ops/s TypicalEntityReaderBenchmark.simpleEntityGeneratedFieldAccess thrpt 10 8814664,064 ± 70241,114 ops/s TypicalEntityReaderBenchmark.simpleEntityGeneratedPropertyAccess thrpt 10 7832454,991 ± 118872,563 ops/s TypicalEntityReaderBenchmark.simpleEntityReflectiveConstructorArgsCreation thrpt 10 4564509,834 ± 38466,637 ops/s TypicalEntityReaderBenchmark.simpleEntityReflectivePropertyAccess thrpt 10 8281840,412 ± 58915,514 ops/s TypicalEntityReaderBenchmark.simpleEntityReflectivePropertyAccessWithCustomConversionRegistry thrpt 10 7326248,088 ± 33168,993 ops/s
…uals(…). We now check for type variable emptiness to avoid Map iterator creation in Map.equals().
odrotbohm
pushed a commit
that referenced
this pull request
Aug 15, 2018
We now use a presized HashMap and Weak references in BasicPersistentEntity to improve memory and CPU profile and and avoid unmodifiable collection creation in BasicPersistentEntity.iterator(). Refactored ClassTypeInformation.from(…) lambda to method reference and predefined collection size for the cache. Reduced object instantiations during TypeDiscoverer.equals(…) by checking for type variable map emptiness to avoid Map iterator creation in Map.equals(…). Original pull request: #305.
odrotbohm
pushed a commit
that referenced
this pull request
Aug 15, 2018
We now use a presized HashMap and Weak references in BasicPersistentEntity to improve memory and CPU profile and and avoid unmodifiable collection creation in BasicPersistentEntity.iterator(). Refactored ClassTypeInformation.from(…) lambda to method reference and predefined collection size for the cache. Reduced object instantiations during TypeDiscoverer.equals(…) by checking for type variable map emptiness to avoid Map iterator creation in Map.equals(…). Original pull request: #305.
odrotbohm
pushed a commit
that referenced
this pull request
Aug 15, 2018
We now use a presized HashMap and Weak references in BasicPersistentEntity to improve memory and CPU profile and and avoid unmodifiable collection creation in BasicPersistentEntity.iterator(). Refactored ClassTypeInformation.from(…) lambda to method reference and predefined collection size for the cache. Reduced object instantiations during TypeDiscoverer.equals(…) by checking for type variable map emptiness to avoid Map iterator creation in Map.equals(…). Original pull request: #305.
odrotbohm
pushed a commit
that referenced
this pull request
Aug 15, 2018
We now use a presized HashMap and Weak references in BasicPersistentEntity to improve memory and CPU profile and and avoid unmodifiable collection creation in BasicPersistentEntity.iterator(). Refactored ClassTypeInformation.from(…) lambda to method reference and predefined collection size for the cache. Reduced object instantiations during TypeDiscoverer.equals(…) by checking for type variable map emptiness to avoid Map iterator creation in Map.equals(…). Original pull request: #305.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Various optimizations to improve CPU and memory consumption.
Baseline
After optimizations
Related tickets: DATACMNS-1366, DATACMNS-1366.