Skip to content

Conversation

@doxlik
Copy link

@doxlik doxlik commented Dec 26, 2025

Hello dear TechEmpower team.

Here I want to add alternative test based on Netty Java framework, but utilizing more aggressive optimizations similar to plaintext top tier players and also utilize fastjson2 lib for json serilization.

I passed verification using "sudo ./tfb --test netty-fast --mode verify"

P.S. This test has no purpose to show that original netty test is bad, on the contrary, it based on it, but adds some maximum possible optimizations + alternative json library.

Copy link
Contributor

@franz1981 franz1981 left a comment

Choose a reason for hiding this comment

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

I won't do this.
Two reasons:

  • this is very very unrealistic and not prod ready (it's not a secure http 1.1 parser)
  • check how we do it right now using SWAR (and indexOf(byte)) in Netty itself

Netty is already low level and I see little benefits to show that if you reduce the parsing cost (increasing it's security risk exposure), it would cost less, since is an expected tradeoff of any framework (unless slow for unrelated reasons).

@doxlik
Copy link
Author

doxlik commented Dec 26, 2025

I will think about utilizing the real parser to increase reality if I succeed I will push it here, if not will delete PR.

@franz1981
Copy link
Contributor

The real parser would work only if you have a bespoke beader map (likely)? Which won't hold any header string based obj

@doxlik
Copy link
Author

doxlik commented Dec 26, 2025

@franz1981 is it better now? Utilized official decoder but preserved custom response writing.

Copy link
Contributor

@franz1981 franz1981 left a comment

Choose a reason for hiding this comment

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

I haven't tried to debug it but tbh I don't such difference with the existing netty code..
I will take a better look while back from holidays next year 🙏

@doxlik
Copy link
Author

doxlik commented Dec 26, 2025

You know, I think you are right. Not so much changes, so better will close PR.

@doxlik doxlik closed this Dec 26, 2025
@doxlik doxlik deleted the netty-fast branch December 26, 2025 22:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants