GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — AsciiString::cached should sanitize the provided String · Issue #13749 · netty/netty

AsciiString::cached should sanitize the provided String  #13749

New issue
Copy link
New issue
Copy link
Closed
#17074
#17007
Closed
AsciiString::cached should sanitize the provided String #13749
#17074
#17007
Copy link
Assignees
franz1981
Labels
improvement
Milestone
4.2.17.Final

Description

@franz1981
franz1981
opened on Dec 24, 2023
Issue body actions

AsciiString::cached is not sanitizing the provided String to match the Latin content into its byte[].
Right now this translate into output errors, but not any functional bug (as far as I can tell), but it prevents using the cached String, while available, to speedup common operations, as explained in https://github.com/netty/netty/pull/13747/files#r1435842167

A typical usage is while users have String-based API (eg for JaxRS,...) wrapping the Netty http headers map and they have to perform any lookup:

  • a fresh new AsciiString::hashCode(String) computation is performed (which we cannot save)
  • the found (if any) AsciiString is compared against the provided String using char-per-char comparisons

The latter operation could be made way faster if the AsciiString::string is a trusted version of the AsciiString content, enabling using String::contentEquals and intimately vectorized/bound-check free equality.

The same approach could be used similarly for the ignore case equality check, leveraging any provided String intrinsic.

Activity

  1. franz1981
    added
    improvement
    on Dec 24, 2023
  2. franz1981
    self-assigned this
    on Dec 24, 2023
  3. vpelikh
    added a commit that references this issue on Jun 29, 2026

    AsciiString.cached(String) should sanitize the provided String (netty…

    7e8e98c
  4. normanmaurer
    added 2 commits that reference this issue on Jul 2, 2026

    Merge branch '4.2' into nettyGH-13749

    ebf8ef0

    AsciiString.cached(String) should sanitize the provided String (#13749)…

    ef10972
  5. normanmaurer
    closed this as completedin #17007on Jul 8, 2026
  6. normanmaurer
    added this to the 4.2.17.Final milestone on Jul 8, 2026
  7. normanmaurer
    added 7 commits that reference this issue on Jul 9, 2026

    Fix AsciiString.cached(String) performance regression (#17074)

    This issue will close once commit 1683570 is merged into the '4.2' branch.
    1683570

    Auto-port 4.1: AsciiString.cached(String) should sanitize the provide…

    This issue will close once commit f257630 is merged into the '4.2' branch.
    f257630

    Auto-port 5.0: AsciiString.cached(String) should sanitize the provide…

    This issue will close once commit 2ebeea5 is merged into the '4.2' branch.
    2ebeea5

    AsciiString.cached(String) should sanitize the provided String (#13749)…

    This issue will close once commit 24c2e38 is merged into the '4.2' branch.
    24c2e38

    Fix AsciiString.cached(String) performance regression (#17074) (#17080)

    This issue will close once commit 8b95db0 is merged into the '4.2' branch.
    8b95db0

    Fix AsciiString.cached(String) performance regression (#17074) (#17083)

    This issue will close once commit 86d4609 is merged into the '4.2' branch.
    86d4609

    Fix AsciiString.cached(String) performance regression (#17074) (#17081)

    This issue will close once commit c44f90c is merged into the '4.2' branch.
    c44f90c
  8. lltopk
    added 4 commits that reference this issue on Oct 24, 2026

    Auto-port 4.1: AsciiString.cached(String) should sanitize the provide…

    92910a8

    AsciiString.cached(String) should sanitize the provided String (netty…

    373c2f0

    Fix AsciiString.cached(String) performance regression (netty#17074) (n…

    24c8fe6

    Fix AsciiString.cached(String) performance regression (netty#17074) (n…

    0dc8222
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @franz1981
    franz1981

Labels

improvement

Type

No type

Projects

No projects

    Milestone

    • 4.2.17.Final

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.