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

Use Java's hardware-accelerated CRC32C implementation where available. #6551

Closed
wants to merge 1 commit into from

Commits on Jun 13, 2023

  1. Use Java's hardware-accelerated CRC32C implementation where available.

    This is the first use of a Java 9 API in Guava, but we use the API only when it's available, so we maintain compatibility with Java 8. Use of Java 9 APIs is relevant to #6549 and #3990 (and also mojohaus/animal-sniffer#67).
    
    I didn't make the same change for `guava-android`, which [will add `java.util.zip.CRC32C` in API Level 34](https://developer.android.com/reference/java/util/zip/CRC32C). I don't know if Android is providing similar performance improvements, so it might not even matter. But even if I wanted to do it, I can't with my current approach, which relies on `MethodHandle`—unless I want to make even the usage of `MethodHandle` conditional on a reflective check :)
    
    RELNOTES=`hash`: Enhanced `crc32c()` to use Java's hardware-accelerated implementation where available.
    PiperOrigin-RevId: 539722059
    cpovirk authored and Google Java Core Libraries committed Jun 13, 2023
    Configuration menu
    Copy the full SHA
    0dae1c4 View commit details
    Browse the repository at this point in the history