Showing posts with label java. Show all posts
Showing posts with label java. Show all posts

2022-07-28

Techempower Framework Benchmark Round 21

 The result for Techempower framework benchmark round 21 is out, as usual the most important benchmark is the update and multi query benchmark:

The top rankers are Rust, JS (cheating), Java, C++, C#, PHP, C, Scala, Kotlin, and Go. For multiple queries:


Top rankers are Rust, Java, JS (cheating), Scala, Kotlin, C++, C#, and Go. These benchmark shows how efficient their database driver (which mostly the biggest bottleneck), and how much overhead the framework of each language (including serialization, alloc/GC, async-I/O, etc).

For memory usage and CPU utilization you can check here https://ajdust.github.io/tfbvis/?testrun=Citrine_started2022-06-30_edd8ab2e-018b-4041-92ce-03e5317d35ea&testtype=update&round=false

2021-12-31

String Associative Array and CombSort Benchmark 2021 Edition

Last year, we've done string associative benchmark and lesser string associative benchmark (measuring string concat operation and built-in associative array set and get), numeric comb sort benchmark and string comb sort benchmark (measuring basic array random access, string conversion, and array swap for number and string), this year's using newer server: 32-core running on 64-bit Ubuntu 21.10. This time we will skip programming languages that are no deb packages (unless the install script is just one line and doesn't ruin system directories) or no direct compile-run command like previous one, also only best of 3 runs.

$ alias time='/usr/bin/time -f "\nCPU: %Us\tReal: %es\tRAM: %MKB"

This time, NodeJS failed to complete (after waiting for an hour) with 10x more data compared to last year for assoc benchmark. Here's the spreadsheet and final result (Real duration and RAM):

LanguageCommand FlagsVersionAssocRAMNum CombRAMStr CombRAMTotalRAM
Gogo rungo1.17.512.392,305,8240.4683,0963.33245,89616.182,634,816
Javajava18-ea+15-Ubuntu-410.705,582,3080.96170,2406.93722,15218.596,474,700
Nimnim r -d:release --gc:arc1.4.217.904,200,2121.2179,4445.45633,81624.564,913,472
Pythonpypy7.3.519.703,104,4402.17140,1245.73523,26427.603,767,828
Ctcc -run0.9.2722.682,820,5681.0180,4844.80392,89628.493,293,948
Juliajulia1.6.523.983,714,4480.52255,8444.60861,07629.104,831,368
Vv -prod run0.2.4 a0a180720.368,910,8562.67124,2486.48470,13629.519,505,240
Lualuajit2.1.0-beta316.701,133,8763.27133,50410.80511,46830.771,778,848
Dartdart2.15.125.922,101,1521.40208,0565.75574,85233.072,884,060
Crystalcrystal run --release1.2.213.772,371,3207.73202,55212.08440,74833.583,014,620
Nimnim r -d:release1.4.224.923,864,1001.7679,5487.511,211,20034.195,154,848
PHPphp8.0.89.941,368,8087.74328,34424.84641,44842.522,338,600
Crystalcrystal run0.35.138.852,372,0049.97179,17622.27441,72071.092,992,900
Vv run0.2.4 a0a180751.818,911,0046.6379,71618.43470,42076.879,461,140
Pythonpython33.9.743.114,106,89229.16405,33243.08722,996115.355,235,220
Nimnim r1.4.288.053,864,0482.9379,53632.601,211,260123.585,154,844
Rubyrubyruby 2.7.4p19152.482,970,90827.15100,32052.23708,940131.863,780,168
Javascriptnodev16.13.1999.999,999,9990.71115,0446.11461,8361006.8110,576,879

FAQ

1. Why you measure the compile duration too? because developer experience also important (feedback loop, edit-rebuild/compile-run), at least for me, it would be sucks a lot if we have to wait a minute to compile before we can test something. We could always write precalculated values with C++ template to make runtime faster for example, but the compilation delay would be very sucks.
2. Why not warming up the VM first? each implementation have it's own advantage and disadvantage. We already know, that compiled language mostly faster at runtime, but at cost of relatively slower development feedback loop. Interpreted language mostly slower at runtime, especially if executed using VM that have startup overhead, in exception of one with AOT or JIT optimization. So to make it fair for every kind of implementation, we do it differently by not glorifying the runtime performance (which super make sense for server or long-lived process, but not best for development or CI cost which people often neglected), but by total performance which consist of Compile duration (if any) + VM startup duration (if any) + AOT or JIT duration (if any) + Runtime duration, so every strategy the PL's implementator use can be fairly judged.
3. Why there's no C++, VB.NET, C#, D, Object-Pascal? don't want to compile things (since there's no build and run command in one flag).  
4. Why there's no Kotlin, Scala, Rust, Elixir, Pony, Swift, Groovy, or Zig? Too lazy to add :3 you can contribute tho (create a pull request, then I'll run the benchmark again as preferably as there's precompiled binary/deb/apt/ppa repository for the compiler/interpreter).
5. Why there's no Ruby 3.1? I can't find any PPA for latest Ruby, latest one on Ubuntu 21.10 repo is Ruby2.7.

Contributorsilmanzo (Nim, Crystal, D), inkydragon (Julia)

2021-07-08

Prime Benchmark

So, yesterday I didn't touch my PC to do a prime number benchmark. And Here's the result for single threaded (only showing fastest implementation of each language) and multithreaded:

IndexImplementationSLabelPassesDurAlgoFaithfulBitPasses/Second
1cpp3flo80_2206675.00baseno144133.26760
10c2daniel202505.00wheelyes14049.85259
11zig3ManDeJ179645.00baseno13592.49823
12c2daniel176815.00wheelyes13536.07129
16rust1mike-b158045.01baseyes83152.68929
20assembly1rberge144345.00baseno82886.80000
22haskell1fatho/119595.00baseno82391.77321
32fortran1johand99875.00baseno11997.40000
36crystal1marghi86805.00baseyes11735.86981
38fsharp3dmanno77545.00baseyes1550.68897
40java1Mansen1488710.0baseyes1488.70000
41csharp1kinema72715.00baseyes1454.08077
43julia2epithe69535.00baseyes11390.55577
46go2ssoves61615.00baseyes11232.01471
51nodejs1rogier57485.00baseyes11149.43213
57lisp2mayerr51225.00baseno11024.19803
58typescript1marghi50315.00baseyes1006.20000
59d2Bradle50035.00baseyes11000.52396
61v1marghi43295.00baseyes865.80000
63lua2ben1je31595.00baseno1631.80000
64nim2beef3328715.00baseyes1574.02096
67cython1rpkak26595.00baseyes8531.64832
71basic1rberge24165.00wheelyes1483.00680
73assemblyscript1donmah423110.0baseyes423.05768
74python2ssoves19915.00baseyes8398.09742
80scala1rom1de12035.00baseyes240.55189
81pascal1rberge11625.00baseyes232.40000
82cobol1fvbake11575.00baseno8231.40000
83pony1marghi11445.00baseyes1228.80000
84swift1j-f1204610.0baseyes204.55332
85dart1eagere8245.00baseyes164.77795
86haxe1TayIor139210.0baseyes139.19035
88ada1BoopBe6615.00baseno132.02220
92octave1octave3135.00baseno62.54234
93postscript1epithe2165.01baseno843.08797
94ruby1rberge1195.01baseyes23.71935
95wren1marghi1115.00baseyes22.16446
96php1Dennis14310.0baseyes14.24667
97smalltalk1fvbake495.07baseyes19.66469
99mixal1rberge304.91baseno16.10998
100perl1marghi285.16baseyes5.42031
103r1fvbake75.43baseyes321.28842
104sql2fvbake65.43otherno321.10375
105tcl1fvbake65.47baseyes11.09589
111latex1tjol217.8baseno320.11224
112bash1bash110.6baseno0.09357

IndexImplementationSLabelPassesDurThreadAlgoFaithfulBitPasses/Second
1zig3ManDe1409105.04wheelno17045.26046
2cpp3flo802361845.08baseno15904.57992
3zig3ManDe1063995.04wheelno15319.64146
4zig3ManDe1010265.04wheelno15051.08785
5zig3ManDe840025.04wheelno14200.08320
6zig3ManDe1478225.08wheelno13695.38740
7zig3ManDe720215.04wheelno13600.73314
8zig3ManDe705225.04wheelno13525.83204
9zig3ManDe1341245.08wheelno13352.91894
10zig3ManDe598515.04baseno82992.45424
11c2danie1013915.08wheelyes12534.43285
12zig3ManDe982465.08wheelno12455.98299
13zig3ManDe981905.08wheelno12454.57327
14zig3ManDe481645.04baseno12408.10849
15zig3ManDe917455.08wheelno12293.50574
16zig3ManDe905985.08wheelno12264.84129
17c2danie881035.08wheelyes12199.97727
18zig3ManDe423185.04baseno12115.85768
19c2danie788585.08wheelyes11969.05838
20zig3ManDe684925.08baseno81712.11852
21c2danie637525.08wheelyes11591.86334
22rust1mike-590015.08baseyes81474.83765
23rust1mike-529795.08baseyes11324.32205
24c2danie498225.08baseyes11244.43126
25zig3ManDe497125.08baseno11242.59124
26c2danie246645.04wheelyes11233.15067
27rust1mike-492385.08baseyes11230.78145
28zig3ManDe456365.08baseno11140.80189
29c2danie223785.04wheelyes11118.88478
30c2danie203855.04wheelyes11019.22065
31c2danie202575.04wheelyes11012.82346
32c2danie151325.04baseyes1756.55294
33cpp2davep200485.08baseyes1501.18496
34d2Bradl195535.08baseyes1488.74973
35zig3ManDe92405.04baseno8461.94272
36zig3ManDe118345.08baseno8295.81332
37csharp1kinem31935.08wheelyes179.81766
38csharp1kinem29615.08baseyes174.02041

Raw result on this gist

2020-05-29

Techempower Framework Benchmark Round 19

The result for Techempower framework benchmark round 19 is out, as usual the most important benchmark is the update and multi query benchmark:


This time, C++ (drogon), Rust (actix) are the top tier performer, followed by Java, Javascript (vertx's es4x), PHP (kumbiaphp+workerman), C# (ASP.NET), C (h2o), Kotlin (kooby), Scala (vertx), Go (fasthttp) and C#.



The top performer for multi-query benchmark are: C++, Rust, Java, Scala, JS, Kotlin, PHP, and Go. It's interesting to see that VLang already entered this benchmark but only on plaintext and json serialization benchmark. Compared to previous benchmark, Scala is in, Python, Perl, and Dart are out of the screenshoted top tier for now.

2019-07-25

The Benchmarker's Web Framework Benchmark

Latest update (2019-07-19) from the-benchmarker's web-framework:

Language (Runtime)Framework (Middleware)Requests / sThroughput
c (11)agoo-c (0.5)199670.00115.49 MB
python (3.7)japronto (0.1)177634.00212.57 MB
java (8)rapidoid (5.5)153167.00275.56 MB
go (1.12)fasthttprouter (0.1)146986.67236.54 MB
python (3.6)vibora (0.0)144171.33163.66 MB
c (99)kore (3.1)142837.67370.30 MB
cpp (11)evhtp (1.2)141011.33136.87 MB
java (8)act (1.8)137266.33236.87 MB
ruby (2.6)agoo (2.8)132990.6776.84 MB
rust (1.36)gotham (0.4)130192.33266.35 MB
crystal (0.29)router.cr (0.2)123911.33116.40 MB
nim (0.2)jester (0.4)123719.00248.70 MB
crystal (0.29)raze (0.3)122186.33114.87 MB
crystal (0.29)spider-gazelle (1.4)120138.00128.27 MB
crystal (0.29)kemal (0.25)114424.33187.01 MB
rust (1.36)actix-web (1.0)114286.67163.27 MB
crystal (0.29)amber (0.28)105704.33193.62 MB
rust (1.36)nickel (0.11)102067.33202.98 MB
csharp (7.3)aspnetcore (2.2)100367.67163.49 MB
rust (1.36)iron (0.6)99692.33125.66 MB
crystal (0.29)orion (1.7)95829.67156.64 MB
go (1.12)gorouter (4.0)91250.00121.51 MB
node (12.6)polkadot (1.0)90498.00135.64 MB
go (1.12)chi (4.0)89401.33119.52 MB
node (12.6)0http (1.0)88940.67133.26 MB
go (1.12)gin (1.4)88229.00154.70 MB
go (1.12)violetear (7.0)87979.00116.68 MB
node (12.6)restana (3.3)87181.67130.61 MB
go (1.12)echo (4.1)86944.33152.32 MB
go (1.12)kami (2.2)85569.00113.85 MB
go (1.12)beego (1.12)83531.33112.24 MB
go (1.12)gorilla-mux (1.7)83107.67110.75 MB
kotlin (1.3)ktor (1.2)76189.67118.63 MB
go (1.12)gf (1.8)73145.67110.94 MB
node (12.6)polka (0.5)71049.67106.46 MB
scala (2.12)akkahttp (10.1)69006.00147.87 MB
node (12.6)rayo (1.3)68066.67102.05 MB
python (3.7)falcon (2.0)60301.00141.34 MB
swift (5.0)perfect (3.1)60239.6756.60 MB
node (12.6)muneem (2.4)58723.6787.98 MB
scala (2.12)http4s (0.18)58317.33102.08 MB
node (12.6)fastify (2.6)58029.33147.94 MB
node (12.6)foxify (0.1)53745.00112.74 MB
java (8)spring-boot (2.1)52174.0039.04 MB
node (12.6)koa (2.7)50993.67107.80 MB
python (3.7)blacksheep (0.1)50145.67102.88 MB
python (3.7)bottle (0.12)49704.67122.36 MB
node (12.6)restify (8.2)45617.0079.87 MB
php (7.3)slim (3.12)43847.33217.11 MB
php (7.3)zend-expressive (3.2)42281.00209.34 MB
php (7.3)symfony (4.3)42019.67208.50 MB
python (3.7)starlette (0.12)41710.6789.72 MB
node (12.6)express (4.17)41081.33100.31 MB
php (7.3)zend-framework (3.1)39650.00196.61 MB
swift (5.0)kitura (2.7)39061.3372.50 MB
ruby (2.6)roda (3.22)38720.6736.90 MB
swift (5.0)vapor (3.3)38685.0064.54 MB
python (3.7)hug (2.5)37882.3393.84 MB
php (7.3)lumen (5.8)37822.00196.49 MB
ruby (2.6)cuba (3.9)35257.0041.55 MB
crystal (0.28)lucky (0.14)33885.0041.73 MB
crystal (0.29)onyx (0.5)32685.6783.76 MB
node (12.6)turbo_polka (2.0)31139.6729.22 MB
ruby (2.6)rack-routing (0.0)29710.3317.13 MB
node (12.6)hapi (18.1)29298.3375.73 MB
php (7.3)laravel (5.8)28941.33151.14 MB
swift (5.0)kitura-nio (2.7)28372.0053.53 MB
python (3.7)fastapi (0.33)27457.6759.12 MB
python (3.7)aiohttp (3.5)23169.0052.40 MB
ruby (2.6)flame (4.18)20298.3311.70 MB
python (3.7)molten (0.27)19610.0036.40 MB
python (3.7)flask (1.1)19088.3346.94 MB
ruby (2.6)hanami (1.3)18242.67137.89 MB
rust (nightly)rocket (0.4)17988.3327.86 MB
python (3.7)bocadillo (0.18)17408.3333.59 MB
python (3.7)sanic (19.6)14934.0026.61 MB
ruby (2.6)sinatra (2.0)14907.3338.66 MB
swift (5.0)swifter (1.4)11351.6714.52 MB
python (3.7)quart (0.9)10817.6721.55 MB
python (3.7)responder (1.3)8826.3319.23 MB
python (3.7)django (2.2)7604.6722.02 MB
python (3.7)tornado (5.1)7089.3320.92 MB
python (3.7)masonite (2.2)6298.6715.47 MB
crystal (0.29)athena (0.7)6247.677.81 MB
ruby (2.6)rails (5.2)3680.3311.28 MB
python (3.7)cyclone (0.0)2889.337.85 MB
It's interesting to see new frameworks (or one that I never heard of.. Vibora, Agoo, and Gotham for example) performing well.
But as usual, this just router, the bottleneck is mostly always the database.