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 — Optimize HTTP startline validation by franz1981 · Pull Request #16030 · netty/netty

Conversation

@franz1981

@franz1981 franz1981 commented Dec 13, 2025

Copy link
Copy Markdown
Contributor

Motivation:
#16020 has introduced too many math operations for something which should really be to handle an exceptional case, impacting performance

Modification:
Simplify the validation logic and allow the JVM to do its magic

Result:
Fixes #16020 with less perf impacts

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@franz1981
Optimize HTTP starline validation
6d938eb
Motivation:
netty#16020 has introduced too many math operations for something which should really be to handle an exceptional case, impacting performance

Modification:
Simplify the validation logic and allow the JVM to do its magic

Result:
Fixes netty#16020 with less perf impacts
@franz1981
franz1981 requested a review from chrisvest December 13, 2025 08:58
@franz1981

franz1981 commented Dec 13, 2025

Copy link
Copy Markdown
Contributor Author

FYI @chrisvest numbers look good on my system. Take a look how they look for you as well!
native image won't be able to optimize this decently :"( @yawkat FYI

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@yawkat

yawkat commented Dec 13, 2025

Copy link
Copy Markdown
Contributor

How fast would three indexOf calls be?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@franz1981
help native image
0a510a0
@franz1981

franz1981 commented Dec 13, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

How fast would three indexOf calls be?

IDK, i suggest to check this first.
It's an exceptional case, so it would expect to fail finding stuff - branches are very cheap if predictable, so I am allowing both native image and JIT to unroll with maximum factor and perform less possible math. I am not sure could be made any faster, unless valid chars fall below SPACE.
I've added a change to help NI too

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

franz1981
franz1981 commented Dec 13, 2025
View reviewed changes
Comment thread codec-http/src/main/java/io/netty/handler/codec/http/HttpUtil.java
for (int i = 0; i < lenBytes; i++) {
char ch = token.charAt(i);
// this is to help AOT compiled code which cannot profile the switch
if (ch <= ' ') {

@franz1981 franz1981 Dec 13, 2025

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could have similarly use a lookup table with 128 boolean and handle the US-ASCII case as

If (c < 128) {
If (invalid[c & 0x7F]) return false;
}

In case is frequent that chars are below SPACE

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@franz1981
franz1981 requested review from normanmaurer and yawkat December 13, 2025 11:39
@franz1981 franz1981 changed the title Optimize HTTP starline validation Optimize HTTP startline validation Dec 13, 2025
yawkat
yawkat approved these changes Dec 13, 2025
View reviewed changes
normanmaurer
normanmaurer approved these changes Dec 13, 2025
View reviewed changes
@normanmaurer

normanmaurer commented Dec 13, 2025

Copy link
Copy Markdown
Member

@chrisvest @vietj PTAL... this looks much simpler

franz1981 reacted with rocket emoji
All reactions
  • 🚀 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@franz1981
Improve benchmark to put more stress to the branch predictor
329a1d7
@franz1981

franz1981 commented Dec 13, 2025

Copy link
Copy Markdown
Contributor Author

FYI @normanmaurer @chrisvest
before these changes:

Benchmark                                                             (samples)   Mode  Cnt        Score        Error      Units
HttpRequestEncoderInsertBenchmark.newEncoder                               1024  thrpt   20  6293080.552 ± 259448.984      ops/s
HttpRequestEncoderInsertBenchmark.newEncoder:IPC                           1024  thrpt    2        3.907               insns/clk
HttpRequestEncoderInsertBenchmark.newEncoder:branch-misses                 1024  thrpt    2        2.130                    #/op
HttpRequestEncoderInsertBenchmark.newEncoder:branches                      1024  thrpt    2      500.909                    #/op
HttpRequestEncoderInsertBenchmark.newEncoder:cycles                        1024  thrpt    2      691.572                    #/op
HttpRequestEncoderInsertBenchmark.newEncoder:instructions                  1024  thrpt    2     2700.620                    #/op
HttpRequestEncoderInsertBenchmark.newEncoder                             128000  thrpt   20  6038428.998 ± 176012.258      ops/s
HttpRequestEncoderInsertBenchmark.newEncoder:IPC                         128000  thrpt    2        3.763               insns/clk
HttpRequestEncoderInsertBenchmark.newEncoder:branch-misses               128000  thrpt    2        3.224                    #/op
HttpRequestEncoderInsertBenchmark.newEncoder:branches                    128000  thrpt    2      503.967                    #/op
HttpRequestEncoderInsertBenchmark.newEncoder:cycles                      128000  thrpt    2      719.314                    #/op
HttpRequestEncoderInsertBenchmark.newEncoder:instructions                128000  thrpt    2     2706.352                    #/op

with this PR:

Benchmark                                                             (samples)   Mode  Cnt        Score        Error      Units
HttpRequestEncoderInsertBenchmark.newEncoder                               1024  thrpt   20  7393557.829 ± 181250.139      ops/s
HttpRequestEncoderInsertBenchmark.newEncoder:IPC                           1024  thrpt    2        4.219               insns/clk
HttpRequestEncoderInsertBenchmark.newEncoder:branch-misses                 1024  thrpt    2        0.287                    #/op
HttpRequestEncoderInsertBenchmark.newEncoder:branches                      1024  thrpt    2      475.720                    #/op
HttpRequestEncoderInsertBenchmark.newEncoder:cycles                        1024  thrpt    2      589.213                    #/op
HttpRequestEncoderInsertBenchmark.newEncoder:instructions                  1024  thrpt    2     2485.964                    #/op
HttpRequestEncoderInsertBenchmark.newEncoder                             128000  thrpt   20  7368505.232 ± 172653.734      ops/s
HttpRequestEncoderInsertBenchmark.newEncoder:IPC                         128000  thrpt    2        4.197               insns/clk
HttpRequestEncoderInsertBenchmark.newEncoder:branch-misses               128000  thrpt    2        0.315                    #/op
HttpRequestEncoderInsertBenchmark.newEncoder:branches                    128000  thrpt    2      477.774                    #/op
HttpRequestEncoderInsertBenchmark.newEncoder:cycles                      128000  thrpt    2      591.765                    #/op
HttpRequestEncoderInsertBenchmark.newEncoder:instructions                128000  thrpt    2     2483.739                    #/op
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@franz1981 franz1981 mentioned this pull request Dec 13, 2025
Regression 4.2.8.Final - HttpUtil.isEncodingSafeStartLineToken incorrectly rejects valid URI characters 'J' and 'M' due to bit-shift modulo behavior #16034
Closed
@franz1981
Remove dead code
ffd766a
@franz1981

franz1981 commented Dec 15, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

@chrisvest I'm waiting the CI to be green and I'm going to merge it to make sure will be in 4.2.9.Final.
The assembly analysis shows that "just the the validation" alone is spedup by 2X with this

....[Hottest Region 1]..............................................................................
c2, level 4, io.netty.microbench.http.HttpUtilBenchmark::checkIsEncodingSafeUri, version 2, compile id 1214 

                                                                               ; - io.netty.microbench.http.HttpUtilBenchmark::checkIsEncodingSafeUri@-1 (line 35)
   0.46%             0x00007f7cc8236eaa:   mov    $0x1,%eax
                     0x00007f7cc8236eaf:   movabs $0x45d37b5d0,%r10            ;   {oop([B{0x000000045d37b5d0})}
                     0x00007f7cc8236eb9:   mov    $0x1,%r11d
          ╭          0x00007f7cc8236ebf:   jmp    0x00007f7cc8236ed3
          │          0x00007f7cc8236ec1:   nopl   0x0(%rax,%rax,1)
          │          0x00007f7cc8236ec9:   nopl   0x0(%rax)
          │     ↗    0x00007f7cc8236ed0:   mov    %r8d,%r11d                   ;*aload_0 {reexecute=0 rethrow=0 return_oop=0}
          │     │                                                              ; - io.netty.handler.codec.http.HttpUtil::isEncodingSafeStartLineToken@14 (line 108)
          │     │                                                              ; - io.netty.microbench.http.HttpUtilBenchmark::checkIsEncodingSafeUri@2 (line 35)
   0.10%  ↘     │    0x00007f7cc8236ed3:   movslq %r11d,%r8                    ;*baload {reexecute=0 rethrow=0 return_oop=0}
                │                                                              ; - java.lang.StringLatin1::charAt@8 (line 46)
                │                                                              ; - java.lang.String::charAt@12 (line 1624)
                │                                                              ; - io.netty.handler.codec.http.HttpUtil::isEncodingSafeStartLineToken@16 (line 108)
                │                                                              ; - io.netty.microbench.http.HttpUtilBenchmark::checkIsEncodingSafeUri@2 (line 35)
   0.36%        │    0x00007f7cc8236ed6:   movzbl 0x10(%r10,%r8,1),%ecx        ;*iand {reexecute=0 rethrow=0 return_oop=0}
                │                                                              ; - java.lang.StringLatin1::charAt@12 (line 46)
                │                                                              ; - java.lang.String::charAt@12 (line 1624)
                │                                                              ; - io.netty.handler.codec.http.HttpUtil::isEncodingSafeStartLineToken@16 (line 108)
                │                                                              ; - io.netty.microbench.http.HttpUtilBenchmark::checkIsEncodingSafeUri@2 (line 35)
   8.81%        │    0x00007f7cc8236edc:   cmp    $0x20,%ecx
                │    0x00007f7cc8236edf:   jle    0x00007f7cc8236f91           ;*if_icmpgt {reexecute=0 rethrow=0 return_oop=0}
                │                                                              ; - io.netty.handler.codec.http.HttpUtil::isEncodingSafeStartLineToken@25 (line 110)
                │                                                              ; - io.netty.microbench.http.HttpUtilBenchmark::checkIsEncodingSafeUri@2 (line 35)
                │    0x00007f7cc8236ee5:   movzbl 0x11(%r10,%r8,1),%ecx        ;*iand {reexecute=0 rethrow=0 return_oop=0}
                │                                                              ; - java.lang.StringLatin1::charAt@12 (line 46)
                │                                                              ; - java.lang.String::charAt@12 (line 1624)
                │                                                              ; - io.netty.handler.codec.http.HttpUtil::isEncodingSafeStartLineToken@16 (line 108)
                │                                                              ; - io.netty.microbench.http.HttpUtilBenchmark::checkIsEncodingSafeUri@2 (line 35)
   9.51%        │    0x00007f7cc8236eeb:   cmp    $0x20,%ecx
           ╭    │    0x00007f7cc8236eee:   jle    0x00007f7cc8236f84           ;*if_icmpgt {reexecute=0 rethrow=0 return_oop=0}
           │    │                                                              ; - io.netty.handler.codec.http.HttpUtil::isEncodingSafeStartLineToken@25 (line 110)
           │    │                                                              ; - io.netty.microbench.http.HttpUtilBenchmark::checkIsEncodingSafeUri@2 (line 35)
           │    │    0x00007f7cc8236ef4:   movzbl 0x12(%r10,%r8,1),%ecx        ;*iand {reexecute=0 rethrow=0 return_oop=0}
           │    │                                                              ; - java.lang.StringLatin1::charAt@12 (line 46)
           │    │                                                              ; - java.lang.String::charAt@12 (line 1624)
           │    │                                                              ; - io.netty.handler.codec.http.HttpUtil::isEncodingSafeStartLineToken@16 (line 108)
           │    │                                                              ; - io.netty.microbench.http.HttpUtilBenchmark::checkIsEncodingSafeUri@2 (line 35)
   9.52%   │    │    0x00007f7cc8236efa:   cmp    $0x20,%ecx
           │    │    0x00007f7cc8236efd:   jle    0x00007f7cc8236f8d           ;*if_icmpgt {reexecute=0 rethrow=0 return_oop=0}
           │    │                                                              ; - io.netty.handler.codec.http.HttpUtil::isEncodingSafeStartLineToken@25 (line 110)
           │    │                                                              ; - io.netty.microbench.http.HttpUtilBenchmark::checkIsEncodingSafeUri@2 (line 35)
           │    │    0x00007f7cc8236f03:   movzbl 0x13(%r10,%r8,1),%ecx        ;*iand {reexecute=0 rethrow=0 return_oop=0}
           │    │                                                              ; - java.lang.StringLatin1::charAt@12 (line 46)
           │    │                                                              ; - java.lang.String::charAt@12 (line 1624)
           │    │                                                              ; - io.netty.handler.codec.http.HttpUtil::isEncodingSafeStartLineToken@16 (line 108)
           │    │                                                              ; - io.netty.microbench.http.HttpUtilBenchmark::checkIsEncodingSafeUri@2 (line 35)
  10.66%   │    │    0x00007f7cc8236f09:   cmp    $0x20,%ecx
           │╭   │    0x00007f7cc8236f0c:   jle    0x00007f7cc8236f7a           ;*if_icmpgt {reexecute=0 rethrow=0 return_oop=0}
           ││   │                                                              ; - io.netty.handler.codec.http.HttpUtil::isEncodingSafeStartLineToken@25 (line 110)
           ││   │                                                              ; - io.netty.microbench.http.HttpUtilBenchmark::checkIsEncodingSafeUri@2 (line 35)
           ││   │    0x00007f7cc8236f0e:   movzbl 0x14(%r10,%r8,1),%ecx        ;*iand {reexecute=0 rethrow=0 return_oop=0}
           ││   │                                                              ; - java.lang.StringLatin1::charAt@12 (line 46)
           ││   │                                                              ; - java.lang.String::charAt@12 (line 1624)
           ││   │                                                              ; - io.netty.handler.codec.http.HttpUtil::isEncodingSafeStartLineToken@16 (line 108)
           ││   │                                                              ; - io.netty.microbench.http.HttpUtilBenchmark::checkIsEncodingSafeUri@2 (line 35)
   9.51%   ││   │    0x00007f7cc8236f14:   cmp    $0x20,%ecx
           ││   │    0x00007f7cc8236f17:   jle    0x00007f7cc8236fac           ;*if_icmpgt {reexecute=0 rethrow=0 return_oop=0}
           ││   │                                                              ; - io.netty.handler.codec.http.HttpUtil::isEncodingSafeStartLineToken@25 (line 110)
           ││   │                                                              ; - io.netty.microbench.http.HttpUtilBenchmark::checkIsEncodingSafeUri@2 (line 35)
           ││   │    0x00007f7cc8236f1d:   movzbl 0x15(%r10,%r8,1),%ecx        ;*iand {reexecute=0 rethrow=0 return_oop=0}
           ││   │                                                              ; - java.lang.StringLatin1::charAt@12 (line 46)
           ││   │                                                              ; - java.lang.String::charAt@12 (line 1624)
           ││   │                                                              ; - io.netty.handler.codec.http.HttpUtil::isEncodingSafeStartLineToken@16 (line 108)
           ││   │                                                              ; - io.netty.microbench.http.HttpUtilBenchmark::checkIsEncodingSafeUri@2 (line 35)
   9.40%   ││   │    0x00007f7cc8236f23:   cmp    $0x20,%ecx
           ││╭  │    0x00007f7cc8236f26:   jle    0x00007f7cc8236f80           ;*if_icmpgt {reexecute=0 rethrow=0 return_oop=0}
           │││  │                                                              ; - io.netty.handler.codec.http.HttpUtil::isEncodingSafeStartLineToken@25 (line 110)
           │││  │                                                              ; - io.netty.microbench.http.HttpUtilBenchmark::checkIsEncodingSafeUri@2 (line 35)
           │││  │    0x00007f7cc8236f28:   movzbl 0x16(%r10,%r8,1),%ecx        ;*iand {reexecute=0 rethrow=0 return_oop=0}
           │││  │                                                              ; - java.lang.StringLatin1::charAt@12 (line 46)
           │││  │                                                              ; - java.lang.String::charAt@12 (line 1624)
           │││  │                                                              ; - io.netty.handler.codec.http.HttpUtil::isEncodingSafeStartLineToken@16 (line 108)
           │││  │                                                              ; - io.netty.microbench.http.HttpUtilBenchmark::checkIsEncodingSafeUri@2 (line 35)
   9.51%   │││  │    0x00007f7cc8236f2e:   cmp    $0x20,%ecx
           │││╭ │    0x00007f7cc8236f31:   jle    0x00007f7cc8236f89           ;*if_icmpgt {reexecute=0 rethrow=0 return_oop=0}
           ││││ │                                                              ; - io.netty.handler.codec.http.HttpUtil::isEncodingSafeStartLineToken@25 (line 110)
           ││││ │                                                              ; - io.netty.microbench.http.HttpUtilBenchmark::checkIsEncodingSafeUri@2 (line 35)
           ││││ │    0x00007f7cc8236f33:   movzbl 0x17(%r10,%r8,1),%ecx        ;*iand {reexecute=0 rethrow=0 return_oop=0}
           ││││ │                                                              ; - java.lang.StringLatin1::charAt@12 (line 46)
           ││││ │                                                              ; - java.lang.String::charAt@12 (line 1624)
           ││││ │                                                              ; - io.netty.handler.codec.http.HttpUtil::isEncodingSafeStartLineToken@16 (line 108)
           ││││ │                                                              ; - io.netty.microbench.http.HttpUtilBenchmark::checkIsEncodingSafeUri@2 (line 35)
   7.54%   ││││ │    0x00007f7cc8236f39:   cmp    $0x20,%ecx
           ││││╭│    0x00007f7cc8236f3c:   jle    0x00007f7cc8236f76           ;*if_icmpgt {reexecute=0 rethrow=0 return_oop=0}
           ││││││                                                              ; - io.netty.handler.codec.http.HttpUtil::isEncodingSafeStartLineToken@25 (line 110)
           ││││││                                                              ; - io.netty.microbench.http.HttpUtilBenchmark::checkIsEncodingSafeUri@2 (line 35)
           ││││││    0x00007f7cc8236f3e:   lea    0x8(%r11),%r8d
   9.93%   ││││││    0x00007f7cc8236f42:   cmp    $0x9e,%r8d
           │││││╰    0x00007f7cc8236f49:   jl     0x00007f7cc8236ed0           ;*if_icmpge {reexecute=0 rethrow=0 return_oop=0}
           │││││                                                               ; - io.netty.handler.codec.http.HttpUtil::isEncodingSafeStartLineToken@11 (line 107)
           │││││                                                               ; - io.netty.microbench.http.HttpUtilBenchmark::checkIsEncodingSafeUri@2 (line 35)
           │││││     0x00007f7cc8236f4b:   add    $0x8,%r11d                   ;*aload_0 {reexecute=0 rethrow=0 return_oop=0}
           │││││                                                               ; - io.netty.handler.codec.http.HttpUtil::isEncodingSafeStartLineToken@14 (line 108)
           │││││                                                               ; - io.netty.microbench.http.HttpUtilBenchmark::checkIsEncodingSafeUri@2 (line 35)
           │││││ ↗   0x00007f7cc8236f4f:   movzbl 0x10(%r10,%r11,1),%ecx       ;*iand {reexecute=0 rethrow=0 return_oop=0}
           │││││ │                                                             ; - java.lang.StringLatin1::charAt@12 (line 46)
           │││││ │                                                             ; - java.lang.String::charAt@12 (line 1624)
           │││││ │                                                             ; - io.netty.handler.codec.http.HttpUtil::isEncodingSafeStartLineToken@16 (line 108)
           │││││ │                                                             ; - io.netty.microbench.http.HttpUtilBenchmark::checkIsEncodingSafeUri@2 (line 35)
   0.06%   │││││ │   0x00007f7cc8236f55:   cmp    $0x20,%ecx
   0.52%   │││││ │   0x00007f7cc8236f58:   jle    0x00007f7cc8236f91           ;*if_icmpgt {reexecute=0 rethrow=0 return_oop=0}
           │││││ │                                                             ; - io.netty.handler.codec.http.HttpUtil::isEncodingSafeStartLineToken@25 (line 110)
           │││││ │                                                             ; - io.netty.microbench.http.HttpUtilBenchmark::checkIsEncodingSafeUri@2 (line 35)
           │││││ │   0x00007f7cc8236f5a:   inc    %r11d                        ;*iinc {reexecute=0 rethrow=0 return_oop=0}
           │││││ │                                                             ; - io.netty.handler.codec.http.HttpUtil::isEncodingSafeStartLineToken@66 (line 107)
           │││││ │                                                             ; - io.netty.microbench.http.HttpUtilBenchmark::checkIsEncodingSafeUri@2 (line 35)
   3.71%   │││││ │   0x00007f7cc8236f5d:   cmp    $0xa5,%r11d
           │││││ ╰   0x00007f7cc8236f64:   jl     0x00007f7cc8236f4f           ;*if_icmpge {reexecute=0 rethrow=0 return_oop=0}
           │││││                                                               ; - io.netty.handler.codec.http.HttpUtil::isEncodingSafeStartLineToken@11 (line 107)
           │││││                                                               ; - io.netty.microbench.http.HttpUtilBenchmark::checkIsEncodingSafeUri@2 (line 35)
           │││││     0x00007f7cc8236f66:   add    $0x20,%rsp
           │││││     0x00007f7cc8236f6a:   pop    %rbp
   6.91%   │││││     0x00007f7cc8236f6b:   cmp    0x28(%r15),%rsp              ;   {poll_return}
           │││││     0x00007f7cc8236f6f:   ja     0x00007f7cc8236fb2
           │││││     0x00007f7cc8236f75:   ret    
           ││││↘     0x00007f7cc8236f76:   add    $0x4,%r11d
           │↘││      0x00007f7cc8236f7a:   add    $0x2,%r11d
           │ ││   ╭  0x00007f7cc8236f7e:   jmp    0x00007f7cc8236f84
           │ ↘│   │  0x00007f7cc8236f80:   add    $0x4,%r11d
           ↘  │   ↘  0x00007f7cc8236f84:   inc    %r11d
              │      0x00007f7cc8236f87:   jmp    0x00007f7cc8236f91
              ↘      0x00007f7cc8236f89:   add    $0x4,%r11d
                     0x00007f7cc8236f8d:   add    $0x2,%r11d                   ;*if_icmpgt {reexecute=0 rethrow=0 return_oop=0}
....................................................................................................
  96.05%  <total for region 1>

Clearly this is the best case scenario with 8 unrolling factor, but is rather unlikely we would get less than 4 as each step of the unrolled body is as simple as

   movzbl 0x10(%r10,%r8,1),%ecx 
   cmp    $0x20,%ecx
   jle    0x00007f7cc8236f91    

which there's no way could be made any faster since it doesn't perform any math (cmp and jle are fused in many CPU args as a single uops) : each cmp + jump still requires to be resolved at the back-end level, and here is limited by the load latency (of the byte extended to 32 bit) without performing any additional math and without data dependencies.
The batchy version (original) instead has a data deps for each batch computation which requires to perform both comparisons and math (bitshift with variable value, which is not free!).

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@normanmaurer

normanmaurer commented Dec 15, 2025

Copy link
Copy Markdown
Member

@franz1981 ready to go in ?

franz1981 reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@normanmaurer normanmaurer added this to the 4.1.130.Final milestone Dec 15, 2025
@franz1981

franz1981 commented Dec 15, 2025

Copy link
Copy Markdown
Contributor Author

Go for it @normanmaurer

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@normanmaurer
normanmaurer merged commit ea911de into netty:4.2 Dec 15, 2025
normanmaurer pushed a commit that referenced this pull request Dec 15, 2025
@franz1981 @normanmaurer
Optimize HTTP startline validation (#16030)
365cb49
Motivation:
#16020 has introduced too many math operations for something which
should really be to handle an exceptional case, impacting performance

Modification:
Simplify the validation logic and allow the JVM to do its magic

Result:
Fixes #16020 with less perf impacts
normanmaurer pushed a commit that referenced this pull request Dec 15, 2025
@franz1981 @normanmaurer
Optimize HTTP startline validation (#16030)
a61d63d
Motivation:
#16020 has introduced too many math operations for something which
should really be to handle an exceptional case, impacting performance

Modification:
Simplify the validation logic and allow the JVM to do its magic

Result:
Fixes #16020 with less perf impacts
normanmaurer pushed a commit that referenced this pull request Dec 15, 2025
@franz1981 @normanmaurer
Optimize HTTP startline validation (#16030)
e3becc8
Motivation:
should really be to handle an exceptional case, impacting performance

Modification:
Simplify the validation logic and allow the JVM to do its magic

Result:
Fixes #16020 with less perf impacts
normanmaurer added a commit that referenced this pull request Dec 15, 2025
@normanmaurer @franz1981
Optimize HTTP startline validation (#16030) (#16042)
54ba03e
Motivation:
#16020 has introduced too many math operations for something which
should really be to handle an exceptional case, impacting performance

Modification:
Simplify the validation logic and allow the JVM to do its magic

Result:
Fixes #16020 with less perf impacts

---------

Co-authored-by: Francesco Nigro <[email protected]>
normanmaurer added a commit that referenced this pull request Dec 15, 2025
@normanmaurer @franz1981
Optimize HTTP startline validation (#16030) (#16043)
a77a549
Motivation:
#16020 has introduced too many math operations for something which
should really be to handle an exceptional case, impacting performance

Modification:
Simplify the validation logic and allow the JVM to do its magic

Result:
Fixes #16020 with less perf impacts

Co-authored-by: Francesco Nigro <[email protected]>
@normanmaurer normanmaurer modified the milestones: 4.1.130.Final, 4.2.9.Final Dec 15, 2025
@franz1981
franz1981 deleted the 4.2_optimized_validation branch December 15, 2025 20:55
@SmartHaven SmartHaven mentioned this pull request Dec 27, 2025
HttpUtil.isEncodingSafeStartLineToken incorrectly rejects valid URIs containing 'J' or 'M' #16089
Closed
@franz1981 franz1981 mentioned this pull request Dec 29, 2025
Simplify ASCII check with Java < 11 smallrye/jandex#637
Closed
@normanmaurer normanmaurer mentioned this pull request Sep 22, 2026
suspend race fix #17588
Closed
@normanmaurer normanmaurer mentioned this pull request Oct 1, 2026
child5 #17695
Closed
This was referenced Oct 20, 2026
fix iouring zerocopy iov overwrite #17936
Closed
crisp nova cceda091 #18109
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@normanmaurer normanmaurer normanmaurer approved these changes
@yawkat yawkat yawkat approved these changes
@chrisvest chrisvest Awaiting requested review from chrisvest

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Exception will be thrown if uri string contains the character 'M'.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@franz1981 @yawkat @normanmaurer
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.