Spontaneous Programming Competition - 1. A Minipc

Expected Deadline: 9.8. (Trixie Release) submissions after this may not be benchmarked

Origin

On a tuesday evening (the 2025-06-17) a bunch of people were interested to see how fast they could implement an application, and then they did, this is the results.

Assignment

Write a program that sorts integers. Input is given from stdin as:
maxValue
numCount
integer1
integer2
...
All output is expected to be on stdout as:
smallest
secondSmallest
...
secondBiggest
biggest
Constraints:

Example data

Given an input of
3
4
1
0
2
0
the output of
0
0
1
2
is expected. More example input: (newlines replaced with spaces to be more compact):
5 20 3 3 4 4 4 1 2 0 0 2 4 1 4 0 4 1 3 0 4 4
and the expected output:
0 0 0 0 1 1 1 2 2 3 3 3 4 4 4 4 4 4 4 4

Submission

Submissions were originally taken via a magic folder. Submissions are currently taken:

Submission Format

Things needed to submit: (Additional) Constraints: On Failure, I try to send back to you: On Success, I will send back to you: By submitting your solution, you implicitely allow your code to be published in this website.

Contestants

AcronymNameLinkWinning Categories (as of now)Special Note
djlDavid Lau---
floFlorian GuthmannCIP-Website--
fsnFrank--Thanks for finding my 2G dataset was incomplete.
(first code with proper error handling)
herLars-Fastest Clean Code-
jarJari-Fastest Live Solution-
jltjohnLateitch.io--
jtkJonathan / thejonny-Least CPU Time Used-
lorLoro / kalydCIP-Website--
lphTeam: lor + pka---
lrmTeam: lor + rom---
marMarian---
maxMaximilian / imur---
pkaPhilip KALUĐERČIĆCIP-WebsiteMost (Esoteric) Submissions, Busiest Beaver, Least Memory Used-
romRoman-Shortest Code-
tbeNikita BloshchanevichGitHubFastest Solution-
zntMichael---

Honor Submissions (which are cool, but could not be benchmarked)

SubmissionLanguageNote
2025-07-17flo10csort.swiftSwift-
2025-06-23flo4Program.csC#Missing Dotnet
2025-06-25flo5sort.jlJuliaMissing Julia
2025-07-17flo9sort.bqnBQN-
2025-06-23pka27csort.leanLean-
2025-06-23pka28csort.klongKlong-
2025-06-25pka41csort.snoSnobolMissing Snobol
2025-06-18pka4csort.standardmlStandard ML-
2025-07-20pka55csort.ijsJ-
2025-07-20pka56csort2.ijsJ-
2025-07-21pka60csort.piPicat-
2025-08-19pka64csort.bsbs-
2025-06-19pka8csort.prologProlog-

Benchmark

Benchmark Mode is: Run the submission 5 times, take the median result for elapsed time.
Currently Benchmarked Sizes are: 100k, 200k, 500k, 1M, 2M, 5M, 10M, 20M, 100M, 200M, 500M, 1G, 2G. (These may change without announcement, you should not specialize your implementation for these.)
To be able to rank slower submissions, I decided to rank based on the 100M integers instead of 2G integers to sort. It seems like all implementations are roughly order the same in the smaller case already.
Ranked Categories are:

Results (as of now)

Waiting for Benchmark

SubmissionLanguageNote

Failing Benchmark

SubmissionLanguageNote

Result Table

Rank Live Submission Language Time User [s] Time System [s] Time Elapsed [s] Memory Used [KiB] Note
- - Optimal Implementation 0.00 0.31 0.31 cat
1-2025-07-14tbe3sort.rsRust1.830.640.491349908Parallel + x86_64 SIMD intrinsics
2-2025-07-10tbe1sort.rsRust1.840.710.511351420Parallel + x86_64 SIMD intrinsics
3-2025-06-21jar8MappedParallel.javaJava4.610.610.811403316Parallel
4-2025-07-24jlt6countreuseaio.cppC++1.070.271.0817672-
5-2025-06-19jtk2countingsort2.cC0.760.311.091350900Least CPU Time Used
6-2025-07-11pka51csort3.zigZig4.371.441.37715836-
7-2025-07-14jlt5radix2.cppC++1.280.441.45794956-
8-2025-07-14jlt4count2.zigZig1.270.231.50677732-
9-2025-07-06jlt1radix.cppC++1.350.502.122128888-
10-2025-07-07lor10reuse.nimNim1.430.742.182548296Out of Memory for 2G
11-2025-06-21jar7ReadMappedWriteMapped.javaJava1.850.302.271392556-
12-2025-07-09pka49csort2.zigZig2.410.222.64676708Parallel
13-2025-06-21jar6ReadMappedSingleBuf.javaJava2.780.273.02721744-
14-2025-06-24lor9readAll.nimNim2.150.883.043221100Out of Memory for 1G
15-2025-07-24djl1isort.x86_64x86_642.920.293.2236692-
1612025-06-17jar5BufReadSingleBuf.javaJava2.960.333.2547732-
17-2025-07-10jlt3count.zigZig3.220.263.4915232-
18-2025-07-31djl2isort.x86_64x86_643.210.303.52938808-
19-2025-06-19jtk1countingsort.cC3.290.303.601350908-
20-2025-06-23lor6read_vec.rsRust3.260.383.65678380-
21-2025-06-21rom4countingsortreadall.rsRust3.920.364.29396304-
2222025-06-17lrm1sort.rsRust4.150.424.57678292-
2332025-06-17lrm2unwrap.rsRust4.370.404.78678420-
24-2025-06-24rom5asyncsort.rsRust6.000.925.4310668-
2542025-06-17jar4SimpleSingleBuf.javaJava5.580.405.88357080-
2652025-06-17lor2sort.rsRust5.600.446.06678476-
2762025-06-17max3fgetc-smart.cC5.960.296.265236-
28-2025-08-05pka62csort2.jsJavaScript5.870.997.01124704-
29-2025-06-21pka19csort.lFlex6.880.317.215320-
3072025-06-17her1cgolf.rsRust8.360.438.81587700Fastest Clean Code
31-2025-07-10jlt2simple.zigZig8.660.349.01401956-
32-2025-06-23pka31csort2.goGo8.790.339.0919612-
3382025-06-17max1fgetc.cC9.120.279.425520Crashes for 500M
3492025-06-17max2stringstream.cppC++9.210.309.526924-
35-2025-06-19fsn1DumbSort.javaJava9.280.379.53355444First Code with Error Handling
36-2025-07-20pka59csort.py.sh.cC13.150.2913.475476Valid Code for Python Bash & C (pka57-pka59)
37-2025-06-26pka42csort.pPascal11.612.1313.763848-
38-2025-06-25flo6sort.mlOcaml13.960.2714.2612536-
39-2025-06-24pka35parsort.shShell4.550.8114.3418500-
40-2025-07-20pka57csort.py.sh.cPython15.700.6816.402097180Valid Code for Python Bash & C (pka57-pka59), Crashes for 2G
41-2025-08-16flo11mmsort.hsHaskell18.770.3519.66684632-
42-2025-06-20flo3array2.hsHaskell19.550.4420.0521000-
43-2025-06-20flo2array.hsHaskell20.600.4421.1020364-
44102025-06-17znt1ihateprogramming.pyPython23.290.4723.22811496-
--2025-06-22pka21csortParallel.f90Fortran90*27.07*0.38*23.26**30614Crashes for 5M
45-2025-06-24pka33shebang.shShell103.681.5533.151050604-
46-2025-06-21pka17csort.f90Fortran9035.980.3536.476416-
47-2025-06-22pka20csort.fFortran7736.070.4036.5230612-
48-2025-07-03pka47csort.dD38.090.5638.77735292-
49-2025-07-09pka50csort.lispLisp39.080.8139.94135656-
50-2025-06-25pka36csort.4thForth59.850.2960.3110840No Output for 200M
51-2025-06-23jtk3shebang.shAwk62.721.6364.388668-
52112025-06-17rom1sort.shShell62.701.7764.528776Shortest Code
53122025-06-17lor3sort-simple.rsRust15.5352.4668.085768-
54-2025-06-24pka34short.shShell67.441.8468.418720-
55-2025-08-05pka61csort.phpPHP21.8951.6373.6048824-
56-2025-06-24lor8sort.nimNim18.8355.4174.3317671044Out of Memory for 200M
57-2025-06-21pka18csort.rbRuby73.830.5274.5121460-
58-2025-06-23mar1simple.goGo23.6253.5277.0420712-
59-2025-06-24lor7sort.nimNim25.8952.1078.085420-
60-2025-07-20pka58csort.py.sh.cBash80.335.7983.333367128Valid Code for Python Bash & C (pka57-pka59), Crashes for 200M
61132025-06-17jar1SimpleSimple.javaJava30.2653.4883.62361924-
62-2025-06-19pka9csort.awkawk85.470.4085.99365796-
63-2025-06-23pka32Csort.javaJava36.5054.0590.182845392Out of Memory for 1G
64-2025-06-27pka44csort.sqlSQL99.591.90101.8212980-
65-2025-06-24jar10csortCachedString.luaLua 5.267.5453.15121.0873924-
66-2025-06-18pka3vector2.lispLisp76.7054.04130.8617520-
67-2025-06-22pka22csortQuadratic.pyPython129.492.06131.274741032Out of Memory for 1G
68-2025-06-22pka25csort.pyPython129.882.06132.164741336Out of Memory for 1G
69-2025-06-25pka39csort2.adbAda32.18102.27134.6411756-
70-2025-06-18pka1hashtable.lispLisp89.2055.10144.6097348-
71-2025-06-24jar11csortPureString.luaLua 5.295.4453.00148.70100496-
72-2025-06-24jar9csortBase.luaLua 5.295.9753.36149.5473880-
73-2025-07-17pka53csort2.scmScheme104.9052.03157.2649256-
74-2025-06-18flo1base.hsHaskell181.013.32184.6613150028-
--2025-06-27pka43csort.psPostscript*104.88*117.56*222.67**50128Crashes for 50M
75-2025-06-25pka37csort.rR118.92109.36227.903947852Puts Additional Empty Lines in the middle at 500M
76-2025-06-20pka16gnubc.bcbc (Gnu)126.85105.49232.7988384Crashes for 2G
77-2025-06-22pka24csort.zigZig27.11208.02235.383708-
78-2025-06-23pka26csort.icnIcon180.9558.79240.0365460-
79-2025-06-25pka40csortJq.shJQ254.173.42257.996747300Out of Memory for 500M
80-2025-06-29pka45csort.tclTCL227.1354.80282.49263068-
81-2025-06-19pka14csortParallel.goGo239.29161.55325.3812252-
82-2025-07-17pka54csort.a68Algol68140.46209.92351.0145728Crash for 500M
83-2025-06-23pka30csort.jsnode.js279.1679.40358.53121400-
84-2025-07-01pka46csort.rakuRaku444.470.91446.00305944-
85-2025-06-29flo8csort.gapGap170.65318.38489.53141948-
86-2025-08-08lph1enomem.cC39.35453.07492.773924-
--2025-06-25flo7sxlsort.shXSLT*563.51*15.31*555.78**49935982Allocation Failure for 20M
87-2025-06-23lor5simple-one-line.hsHaskell616.224.51621.8614463932Out of Memory for 500M
88-2025-06-23lor4sort-simple.hsHaskell620.854.44626.3714673912Out of Memory for 200M
--2025-07-26lor11pad-zero.hsHaskell*1271.83*21.23*1294.93**75854990Out of Memory for 50M
89-2025-06-25pka38csort.mMatlab (Octave)1963.05180.592146.1157540-
90-2025-06-19pka11csort.plan9cPlan 9 C*1006.18*3810.02*4816.20**-1Benchmarked in Fort 9 VM with ~95% Overhead
91-2025-08-06pka63csort-ets.erlErlang32382.28
8 h
2108.99
35 min
22636.97
6 h
828808-
92-2025-06-19pka10csort.erlErlang*32329.25
8 h
*3216.70
53 min
*23317.77
6 h
**567365-
--2025-06-19pka7csort.smalltalkSmalltalk*46969.71
13 h
*1582.37
26 min
*48668.72
13 h
**17592098Out of Memory for 10M
--2025-07-17pka52csort2.apl.shAPL*3745877.92
43 d
*967171.73
11 d
*4703436.16
54 d
**22053779Crashes for 2M
93-2025-06-20pka15dc.shdc*18709579.66
216 d
*4671.26
1 h
*18737950.72
216 d
**97735-
*Estimated Time: conservative lower bound for the real runtime the programs would have.
**Estimated Memory Use: realistic estimation of memory usage, negative one is used for values, that could not be estimated.

Result Graphs

Elapsed Time over Integers to Sort
Time per Item over Integers to Sort
Performance Graph: Time per Item over Integers to Sort

Code

TBA