{"id":13511851,"url":"https://github.com/smallnest/Jax-RS-Performance-Comparison","last_synced_at":"2025-03-30T21:31:05.106Z","repository":{"id":2368788,"uuid":"46332022","full_name":"smallnest/Jax-RS-Performance-Comparison","owner":"smallnest","description":":zap: Performance Comparison of Jax-RS implementations and embedded containers","archived":true,"fork":false,"pushed_at":"2023-04-14T01:41:28.000Z","size":10872,"stargazers_count":186,"open_issues_count":8,"forks_count":76,"subscribers_count":24,"default_branch":"master","last_synced_at":"2025-01-19T04:33:08.776Z","etag":null,"topics":["benchmark","dropwizard","jax-rs","jersey","resteasy","restful","spring-boot","vertx"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/smallnest.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2015-11-17T08:04:27.000Z","updated_at":"2024-11-28T12:56:00.000Z","dependencies_parsed_at":"2023-07-05T18:02:13.177Z","dependency_job_id":null,"html_url":"https://github.com/smallnest/Jax-RS-Performance-Comparison","commit_stats":{"total_commits":42,"total_committers":8,"mean_commits":5.25,"dds":0.5476190476190477,"last_synced_commit":"cda1d6211c602e730a1486926d8e43fcf5d5e8d9"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smallnest%2FJax-RS-Performance-Comparison","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smallnest%2FJax-RS-Performance-Comparison/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smallnest%2FJax-RS-Performance-Comparison/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smallnest%2FJax-RS-Performance-Comparison/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/smallnest","download_url":"https://codeload.github.com/smallnest/Jax-RS-Performance-Comparison/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246385072,"owners_count":20768661,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["benchmark","dropwizard","jax-rs","jersey","resteasy","restful","spring-boot","vertx"],"created_at":"2024-08-01T03:01:13.908Z","updated_at":"2025-03-30T21:31:05.082Z","avatar_url":"https://github.com/smallnest.png","language":"Java","funding_links":[],"categories":["Java"],"sub_categories":[],"readme":"# Jax-RS-Performance-Comparison\nPerformance Comparison of Jax-RS implementations and embedded containers\n\n[![Build Status](https://drone.io/github.com/smallnest/Jax-RS-Performance-Comparison/status.png)](https://drone.io/github.com/smallnest/Jax-RS-Performance-Comparison/latest)\n\n[Gajotres](http://www.gajotres.net/best-available-java-restful-micro-frameworks/#author-box) have written an article: [Top 8 Java RESTful Micro Frameworks](http://www.gajotres.net/best-available-java-restful-micro-frameworks/). He listed 8 best light weight Java RESTful framework.\nPersonally, I perfer jax-rs implementations and micro frameworks for deploying applications as micro services and those micro services can be deployed in docker containers.\n\nSo I have test five Jax-RS implementations plus embedded containers despite business logics. The RESTful service is very simple and it only returns a \"hello world\" string. Remember,  tests don't contain any business logics even JSON libraries.\nThere are other articles to dicuss serialization framework. For example, [my test](http://colobu.com/2014/08/26/java-serializer-comparison/)\n\nI have added more RESTful framework besides Jax-RS implementation, which contains:\n* Spring-boot\n* RESTEasy + Netty4\n* Native Netty\n* Vert.x\n* Go\n\n\nYou can check the test result and the performancre chart.\n\n### Compile applications\nIt is a multiple-module maven project.\nYou can run \"mvn package\" in parent directory to packge each module.\nIt generates a fat-jar in target directories of modules for each module.\nIt is easy.\n\n### Test Environment\n**Server**\nAWS C3.2xlarge\n- 8 cores (E5-2666 v3 @ 2.90GHz)\n- memory: 16G (only allocate 4G for restful applications)\n\n**Java**\n1.8.0_51\n\n**Test tool**\n[wrk](https://github.com/wg/wrk)\nthe test cmd is like: `wrk -t16 -c1000 -d30s http://127.0.0.1:8080/rest/hello `.\nI use 16 threads and 100/200/500/1000 connnections to test each case.\n\n**Starting Server**\n```\njava -Xmx4g -Xms4g -jar jersey-grizzly2-1.0-SNAPSHOT.jar\njava -Xmx4g -Xms4g -jar jersey-jetty-1.0-SNAPSHOT.jar\njava -Xmx4g -Xms4g -jar dropwizard-1.0-SNAPSHOT.jar hello.yml \njava -Xmx4g -Xms4g -jar resteasy-netty-1.0-SNAPSHOT.jar \njava -Xmx4g -Xms4g -jar resteasy-undertow-1.0-SNAPSHOT.jar\njava -Xmx4g -Xms4g -jar springboot-1.0-SNAPSHOT.jar\njava -Xmx4g -Xms4g -jar resteasy-netty4-1.0-SNAPSHOT.jar \njava -Xmx4g -Xms4g -jar nativenetty-1.0-SNAPSHOT.jar\njava -Xmx4g -Xms4g -jar vertx-1.0-SNAPSHOT.jar\njava -Xmx4g -Xms4g -jar swagger-light-java-1.0.0.jar\n```\n\n### Test Result\n\nTest data is [here](TestData.md)\n\n![](performance.png)\n\n### Conclusion\nIt looks Resteasy is better than jersey whatever jersey uses grizzly2 or jetty container.\n\nIt is predictable that performance of dropwizard is same to jersey+jetty.\n\nResteasy is excellent in undertow and netty.\n\nTo my surprise is resteasy+undertow is a little better than resteasy+netty. Maybe they are all developed by JBoss and they have done some optimization.\n\nI do not recommend you use spring boot in large projects because its performance and style.\n\nOf course native netty is number one but my test has not contains a http router so maybe you can't say it is RESTful framework. But I like its perforamnce.\n\nPerformance of RESTEasy+netty4 is lower than what i expect. but RESTEasy+netty3 is very good.\n\n~~One interesting framework is Vert.x. I like its functional programming style but its performance is not so good.~~\n\n\n\nI have not monitored the CPU usage and memory usage. You can try it. \n\n### Update\n* 2015/11/19 add native go, go-restful codes\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmallnest%2FJax-RS-Performance-Comparison","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmallnest%2FJax-RS-Performance-Comparison","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmallnest%2FJax-RS-Performance-Comparison/lists"}