Skip to content

Replace Unsafe with VarHandle #67

@qweek

Description

@qweek

I tested my implementation for Java 9+ with VarHandles instead of Unsafe.
In my test case (hashing multiple files with a total size of ~ 1 GB) I noticed a huge speed improvement

  • XxHash: Unsafe 1220 ms vs VarHandle 630 ms
  • XxHash3: Unsafe 1280 ms vs VarHandle 720 ms

Is it possible to publish separate version for modern JDKs without dependency on Unsafe?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions