Skip to content
This repository was archived by the owner on Jan 26, 2026. It is now read-only.

Micro opt merge to main#23

Merged
expanded-for-real merged 54 commits intomainfrom
micro-opt-merge-to-main
Jun 18, 2025
Merged

Micro opt merge to main#23
expanded-for-real merged 54 commits intomainfrom
micro-opt-merge-to-main

Conversation

@expanded-for-real
Copy link
Collaborator

@expanded-for-real expanded-for-real commented Jun 17, 2025

#20

Remove overhead caused by dynamic dispatch (important since we're competing with some aggressively optimized frameworks). The main work here was basically just getting rid of the Value and TypeHandler class and moving the logic into static/final classes that we can just invoke through case/switch branching instead of the interface/abstract strategy pattern (which was nice, but virtual overhead there seemed to be too much when going up against things like flatbuffers/protobuf/jackson). So it looks like a lot was changed but functionally, that's it - just making things static and breaking down the interface

Previous best time for the serialization hotpath was about 5.1 microseconds and this update alone pulls it down to about 2.3 microseconds (maybe my computer just had a good day though because that seems like way too much of a gain, but JMH reports it). All tests passing and looking good so far.

Also I don't know why this keeps forcing me to rebase but I'll clean up the repo

expanded-for-real and others added 30 commits June 17, 2025 08:04
…mance tracking; add comprehensive String benchmark
A full list of enhancements can be found here - #3
…ome micro-optimizations added that were found along the way
* Full comprehensive comparison tests with a lot of other libraries + some micro-optimizations added that were found along the way

* replace deprecated gradle methods with latest

---------

Co-authored-by: expand3d <>
…es in gradle file. Also fix permission issue
expand3d added 23 commits June 17, 2025 08:05
Adds Apache Thrift to the benchmark suite, including self-contained compiler download. Corrects Protobuf and FlatBuffers schemas and fixes bugs in the competitor classes to ensure a stable and robust benchmark environment. Includes refactored DataGenerator.
# Conflicts:
#	src/jmh/java/com/imprint/benchmark/ComparisonBenchmark.java
#	src/jmh/java/com/imprint/benchmark/FieldAccessBenchmark.java
#	src/jmh/java/com/imprint/benchmark/SerializationBenchmark.java
#	src/jmh/java/com/imprint/benchmark/serializers/ImprintSerializingBenchmark.java
#	src/main/java/com/imprint/core/ImprintFieldObjectMap.java
#	src/main/java/com/imprint/core/ImprintRecord.java
#	src/main/java/com/imprint/core/ImprintRecordBuilder.java
#	src/main/java/com/imprint/ops/ImprintOperations.java
#	src/main/java/com/imprint/types/TypeCode.java
#	src/main/java/com/imprint/types/TypeHandler.java
#	src/main/java/com/imprint/types/Value.java
#	src/test/java/com/imprint/IntegrationTest.java
#	src/test/java/com/imprint/ops/ImprintOperationsTest.java
#	src/test/java/com/imprint/profile/ProfilerTest.java
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

specific imprint benchmark to isolate just our own hot path

Copy link
Contributor

@agavra agavra left a comment

Choose a reason for hiding this comment

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

Skimmed the changes but it's a bit subtle and touches lots of code so it's hard to for me to review in detail. Overall LGTM.

@expanded-for-real expanded-for-real merged commit ac213f5 into main Jun 18, 2025
3 checks passed
@expanded-for-real expanded-for-real deleted the micro-opt-merge-to-main branch June 18, 2025 00:00
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants