Skip to content
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

Benchmarks for Java Records using java.io.Serializable #88

Open
ChrisTrenkamp opened this issue Jan 25, 2022 · 1 comment
Open

Benchmarks for Java Records using java.io.Serializable #88

ChrisTrenkamp opened this issue Jan 25, 2022 · 1 comment

Comments

@ChrisTrenkamp
Copy link

https://blogs.oracle.com/javamagazine/post/simpler-object-and-data-serialization-using-java-records

Oracle is claiming ObjectOutputStream/ObjectInputStream have optimizations for Java Records. Can we implement a benchmark to see if Java serialization is any faster with records rather than plain classes?

@cakoose
Copy link
Collaborator

cakoose commented Jan 25, 2022

I think that would be a valuable addition to the benchmark. Not sure how familiar you are with this codebase, but if you're interested in adding this yourself:

  1. Write the equivalent of the classes in "tpc/src/data/media", except using records. Put them in "tpc/src/serializers/java-records/media".
  2. Create "tpc/src/serializers/java-records/JavaRecordsBuiltIn.java".
    • Start by copying "tpc/src/serializers/JavaBuiltIn.java".
    • Change the forward and reverse methods to convert between the "tpc/src/data/media" types and your new record-based types.
    • Modify the serializer implementation to use your new types.

One thing that might concern people is the dependency on Java 16. But I dunno, maybe it's fine?

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

No branches or pull requests

2 participants