Skip to content

Conversation

@gyakkun
Copy link
Contributor

@gyakkun gyakkun commented May 18, 2025

muserver is a netty-based, jax-rs compatible http server implementation in Java.

The test is written in common pattern of muserver, including a jax-rs resource class handler implementation (the default one) and a library built-in MuHandler implementation (reduces reflection and should be faster).

Scaffolding scripts and dockerfiles are modified from netty.

The database connection and ORM part is modified from Javalin tests.

Verified on local machine:

image

@gyakkun gyakkun marked this pull request as draft May 19, 2025 07:42
@franz1981
Copy link
Contributor

franz1981 commented May 19, 2025

Please @gyakkun can you reference the work made at https://github.com/franz1981/Netty-VirtualThread-Scheduler or in #9800 🙏?

I suggest to look at micronaut-projects/micronaut-core#11704 if you are using the loom event loop as a carrier with ORM or jdbc

@gyakkun
Copy link
Contributor Author

gyakkun commented May 22, 2025

Please @gyakkun can you reference the work made at https://github.com/franz1981/Netty-VirtualThread-Scheduler or in #9800 🙏?

I suggest to look at micronaut-projects/micronaut-core#11704 if you are using the loom event loop as a carrier with ORM or jdbc

Thank you for your advice. Have done some other stress tests and observed other issue. Let me remove those loom and io_uring experiments and keep this PR simple first. Never too late to make things more complicated.

@gyakkun gyakkun marked this pull request as ready for review May 22, 2025 06:52
@Path("/json")
@Produces(APPLICATION_JSON)
public Map<String, String> json() {
return helloWorld;
Copy link
Member

Choose a reason for hiding this comment

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

Unless you're recreating the TFBResource on every request, this violates the JSON test rules.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure. Fixed accordingly.

@Path("/plaintext")
@Produces(TEXT_PLAIN)
public String plaintext() {
return "Hello, World!";
Copy link
Member

Choose a reason for hiding this comment

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

I'm going to merge this one, but technically our PLAINTEXT test rules mean that you could literally make this a statically allocated byte array and simply use it here instead of returning a new instance every call.

@msmith-techempower msmith-techempower merged commit a40500b into TechEmpower:master May 23, 2025
3 checks passed
litongjava pushed a commit to litongjava/FrameworkBenchmarks that referenced this pull request May 30, 2025
* [Java/muserver] Add muserver.

* Create object on request to adhere TFB rules.
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.

3 participants