<commit_before>nio-benchmark
=============

Sample applications to compare performance between regular java servlets/web services with nio versions.

Build the project with maven. You will get 3 artifacts:
* war.war: webapp to deploy on an application server, port 8080
* HelloServer.jar: launch with java -jar HelloServer.jar will listen on port 8081
* TestServer.jar: launch with java -jar TestServer.jar will listen on port 8082

Available urls:
Url | Comment
--- | ---
http://localhost:8080/war/hello | a test service implemented with a classic servlet that says hello
http://localhost:8080/war/helloasync | an async servlet that says hello after 1 s
http://localhost:8080/war/test1 | a classic servlet that calls the test service with a classic HttpClient
http://localhost:8080/war/test2 | an async servlet that calls the test service wiht an HttpAsyncClient
http://localhost:8081/war/hello | an async test service implemented with HttpCore NIO that says hello
http://localhost:8081/war/slowhello | an async test service implemented with HttpCore NIO that says hello after 50 ms
http://localhost:8082/war/test3 | an async server implemented with HttpCore NIO that calls the test service with an HttpAsyncClient<commit_msg>Documentation<commit_after>nio-benchmark
=============

Sample applications to compare performance between regular java servlets/web services with nio versions.

Build the project with maven. You will get 3 artifacts:
* war.war: webapp to deploy on an application server, port 8080
* HelloServer.jar: launch with java -jar HelloServer.jar will listen on port 8081
* TestServer.jar: launch with java -jar TestServer.jar will listen on port 8082

Some configuration files samples for Jetty, Tomcat and Linux are available in "conf" folder.

Available urls to test once the applications are running:
Url | Comment
--- | ---
http://localhost:8080/war/hello | a test service implemented with a classic servlet that says hello
http://localhost:8080/war/helloasync | an async servlet that says hello after 1 s
http://localhost:8080/war/test1 | a classic servlet that calls the test service with a classic HttpClient
http://localhost:8080/war/test2 | an async servlet that calls the test service wiht an HttpAsyncClient
http://localhost:8081/war/hello | an async test service implemented with HttpCore NIO that says hello
http://localhost:8081/war/slowhello | an async test service implemented with HttpCore NIO that says hello after 50 ms
http://localhost:8082/war/test3 | an async server implemented with HttpCore NIO that calls the test service with an HttpAsyncClient

To test with Apache Benchmark:
ab -r -k -c10000 -n10000 http://localhost:8080/war/test1
{'fraction_non_alphanumeric': 0.07502799552071669, 'fraction_numerical': 0.04068682344158268, 'mean_word_length': 4.726495726495727, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '389315', 'n_tokens_mistral': 770, 'n_tokens_neox': 679, 'n_words': 331}