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

Zero Copy and Optimizations#18

Closed
expanded-for-real wants to merge 55 commits intomainfrom
zero-copy
Closed

Zero Copy and Optimizations#18
expanded-for-real wants to merge 55 commits intomainfrom
zero-copy

Conversation

@expanded-for-real
Copy link
Collaborator

Addresses these issues:
#17
#14
#12
#10

Zero Copy implementation led to a change in the underlying abstraction (removal of the ImprintBuffers class) and tried to create a stronger boundary between the consumer(deserializing/merge/projecting) side with the producing side (serializing). Current benchmark results are below. Merge is indeed faster than anything else but further optimizations will probably require Unsafe and some elaborate SWAR setup like Jackson and Netty have for UTF8 conversions.

Benchmark Results

mergeAndSerialize

Framework Mode Cnt Score (ns/op) Error (ns/op)
Imprint avgt 7 1237.536 ±188.873
Jackson-JSON avgt 7 11744.677 ±2023.211
Protobuf avgt 7 7177.688 ±460.645
FlatBuffers avgt 7 1661.175 ±178.084
Avro-Generic avgt 7 11469.972 ±3506.027
Thrift avgt 7 5738.422 ±472.948
Kryo avgt 7 5118.342 ±841.488
MessagePack avgt 7 12403.641 ±995.149

projectAndSerialize

Framework Mode Cnt Score (ns/op) Error (ns/op)
Imprint avgt 7 547.601 ±38.770
Jackson-JSON avgt 7 5321.537 ±695.760
Protobuf avgt 7 2120.023 ±280.050
FlatBuffers avgt 7 316.252 ±33.684
Avro-Generic avgt 7 4680.088 ±859.520
Thrift avgt 7 1647.197 ±172.624
Kryo avgt 7 2486.407 ±214.266
MessagePack avgt 7 5541.148 ±758.440

serialize

Framework Mode Cnt Score (ns/op) Error (ns/op)
Imprint avgt 7 5435.692 ±447.959
Jackson-JSON avgt 7 2154.194 ±80.240
Protobuf avgt 7 2201.375 ±107.610
FlatBuffers avgt 7 1202.734 ±129.512
Avro-Generic avgt 7 2137.613 ±392.575
Thrift avgt 7 2921.587 ±535.176
Kryo avgt 7 2002.497 ±171.343
MessagePack avgt 7 3311.102 ±280.393

expanded-for-real and others added 30 commits June 1, 2025 13:23
…mance tracking; add comprehensive String benchmark
Try to enhance string deserialization
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 <>
# Conflicts:
#	src/jmh/java/com/imprint/benchmark/ComparisonBenchmark.java
#	src/main/java/com/imprint/core/ImprintRecord.java
#	src/main/java/com/imprint/types/TypeHandler.java
#	src/main/java/com/imprint/types/Value.java
expand3d added 25 commits June 5, 2025 15:23
…es in gradle file. Also fix permission issue
# Conflicts:
#	.github/workflows/ci.yml
#	build.gradle
#	src/jmh/java/com/imprint/benchmark/ComparisonBenchmark.java
#	src/main/java/com/imprint/core/ImprintRecord.java
#	src/main/java/com/imprint/types/TypeHandler.java
#	src/main/java/com/imprint/types/Value.java
# Conflicts:
#	.github/workflows/ci.yml
#	build.gradle
#	src/jmh/java/com/imprint/benchmark/ComparisonBenchmark.java
#	src/main/java/com/imprint/core/ImprintRecord.java
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/main/java/com/imprint/core/ImprintBuffers.java
#	src/main/java/com/imprint/core/ImprintRecord.java
#	src/test/java/com/imprint/profile/ProfilerTest.java
@expanded-for-real expanded-for-real deleted the zero-copy 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.

1 participant