Home / Function/ hashCodeBenchBytesOld() — netty Function Reference

hashCodeBenchBytesOld() — netty Function Reference

Architecture documentation for the hashCodeBenchBytesOld() function in AsciiStringBenchmark.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  238f98e6_2277_c432_c38b_659eb167b882["hashCodeBenchBytesOld()"]
  aff6af82_71b2_329f_41cf_d30a3ab60974["AsciiStringBenchmark"]
  238f98e6_2277_c432_c38b_659eb167b882 -->|defined in| aff6af82_71b2_329f_41cf_d30a3ab60974
  style 238f98e6_2277_c432_c38b_659eb167b882 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

microbench/src/main/java/io/netty/microbenchmark/common/AsciiStringBenchmark.java lines 64–74

    @Benchmark
    public int hashCodeBenchBytesOld() {
        int h = 0;
        final int end = asciiString.arrayOffset() + asciiString.length();
        for (int i = asciiString.arrayOffset(); i < end; ++i) {
            // masking with 0x1F reduces the number of overall bits that impact the hash code but makes the hash
            // code the same regardless of character case (upper case or lower case hash is the same).
            h = h * 31 + (asciiString.array()[i] & 0x1F);
        }
        return h;
    }

Domain

Subdomains

Frequently Asked Questions

What does hashCodeBenchBytesOld() do?
hashCodeBenchBytesOld() is a function in the netty codebase, defined in microbench/src/main/java/io/netty/microbenchmark/common/AsciiStringBenchmark.java.
Where is hashCodeBenchBytesOld() defined?
hashCodeBenchBytesOld() is defined in microbench/src/main/java/io/netty/microbenchmark/common/AsciiStringBenchmark.java at line 64.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free