Skip to content

Instantly share code, notes, and snippets.

@renatoathaydes
Created January 14, 2024 15:51
Show Gist options
  • Save renatoathaydes/ab5c86b0ea59152693a7236c333ac334 to your computer and use it in GitHub Desktop.
Save renatoathaydes/ab5c86b0ea59152693a7236c333ac334 to your computer and use it in GitHub Desktop.
DLang - comparison with Java, Rust and Common Lisp
Display the source blob
Display the rendered blob
Raw
<svg width="512" height="360" viewBox="0 0 512 360" xmlns="http://www.w3.org/2000/svg">
<rect x="0" y="0" width="512" height="360" opacity="1" fill="#FFFFFF" stroke="none"/>
<text x="256" y="15" dy="0.76em" text-anchor="middle" font-family="sans-serif" font-size="25.806451612903228" opacity="1" fill="#000000">
Time and Memory Comparison
</text>
<line opacity="0.1" stroke="#000000" stroke-width="1" x1="50" y1="314" x2="50" y2="46"/>
<line opacity="0.1" stroke="#000000" stroke-width="1" x1="130" y1="314" x2="130" y2="46"/>
<line opacity="0.1" stroke="#000000" stroke-width="1" x1="210" y1="314" x2="210" y2="46"/>
<line opacity="0.1" stroke="#000000" stroke-width="1" x1="290" y1="314" x2="290" y2="46"/>
<line opacity="0.1" stroke="#000000" stroke-width="1" x1="370" y1="314" x2="370" y2="46"/>
<line opacity="0.1" stroke="#000000" stroke-width="1" x1="451" y1="314" x2="451" y2="46"/>
<line opacity="0.1" stroke="#000000" stroke-width="1" x1="50" y1="300" x2="451" y2="300"/>
<line opacity="0.1" stroke="#000000" stroke-width="1" x1="50" y1="285" x2="451" y2="285"/>
<line opacity="0.1" stroke="#000000" stroke-width="1" x1="50" y1="277" x2="451" y2="277"/>
<line opacity="0.1" stroke="#000000" stroke-width="1" x1="50" y1="271" x2="451" y2="271"/>
<line opacity="0.1" stroke="#000000" stroke-width="1" x1="50" y1="266" x2="451" y2="266"/>
<line opacity="0.1" stroke="#000000" stroke-width="1" x1="50" y1="262" x2="451" y2="262"/>
<line opacity="0.1" stroke="#000000" stroke-width="1" x1="50" y1="259" x2="451" y2="259"/>
<line opacity="0.1" stroke="#000000" stroke-width="1" x1="50" y1="256" x2="451" y2="256"/>
<line opacity="0.1" stroke="#000000" stroke-width="1" x1="50" y1="253" x2="451" y2="253"/>
<line opacity="0.1" stroke="#000000" stroke-width="1" x1="50" y1="251" x2="451" y2="251"/>
<line opacity="0.1" stroke="#000000" stroke-width="1" x1="50" y1="251" x2="451" y2="251"/>
<line opacity="0.1" stroke="#000000" stroke-width="1" x1="50" y1="236" x2="451" y2="236"/>
<line opacity="0.1" stroke="#000000" stroke-width="1" x1="50" y1="228" x2="451" y2="228"/>
<line opacity="0.1" stroke="#000000" stroke-width="1" x1="50" y1="222" x2="451" y2="222"/>
<line opacity="0.1" stroke="#000000" stroke-width="1" x1="50" y1="217" x2="451" y2="217"/>
<line opacity="0.1" stroke="#000000" stroke-width="1" x1="50" y1="213" x2="451" y2="213"/>
<line opacity="0.1" stroke="#000000" stroke-width="1" x1="50" y1="210" x2="451" y2="210"/>
<line opacity="0.1" stroke="#000000" stroke-width="1" x1="50" y1="207" x2="451" y2="207"/>
<line opacity="0.1" stroke="#000000" stroke-width="1" x1="50" y1="205" x2="451" y2="205"/>
<line opacity="0.1" stroke="#000000" stroke-width="1" x1="50" y1="202" x2="451" y2="202"/>
<line opacity="0.1" stroke="#000000" stroke-width="1" x1="50" y1="202" x2="451" y2="202"/>
<line opacity="0.1" stroke="#000000" stroke-width="1" x1="50" y1="188" x2="451" y2="188"/>
<line opacity="0.1" stroke="#000000" stroke-width="1" x1="50" y1="179" x2="451" y2="179"/>
<line opacity="0.1" stroke="#000000" stroke-width="1" x1="50" y1="173" x2="451" y2="173"/>
<line opacity="0.1" stroke="#000000" stroke-width="1" x1="50" y1="168" x2="451" y2="168"/>
<line opacity="0.1" stroke="#000000" stroke-width="1" x1="50" y1="165" x2="451" y2="165"/>
<line opacity="0.1" stroke="#000000" stroke-width="1" x1="50" y1="161" x2="451" y2="161"/>
<line opacity="0.1" stroke="#000000" stroke-width="1" x1="50" y1="158" x2="451" y2="158"/>
<line opacity="0.1" stroke="#000000" stroke-width="1" x1="50" y1="156" x2="451" y2="156"/>
<line opacity="0.1" stroke="#000000" stroke-width="1" x1="50" y1="154" x2="451" y2="154"/>
<line opacity="0.1" stroke="#000000" stroke-width="1" x1="50" y1="154" x2="451" y2="154"/>
<line opacity="0.1" stroke="#000000" stroke-width="1" x1="50" y1="139" x2="451" y2="139"/>
<line opacity="0.1" stroke="#000000" stroke-width="1" x1="50" y1="130" x2="451" y2="130"/>
<line opacity="0.1" stroke="#000000" stroke-width="1" x1="50" y1="124" x2="451" y2="124"/>
<line opacity="0.1" stroke="#000000" stroke-width="1" x1="50" y1="120" x2="451" y2="120"/>
<line opacity="0.1" stroke="#000000" stroke-width="1" x1="50" y1="116" x2="451" y2="116"/>
<line opacity="0.1" stroke="#000000" stroke-width="1" x1="50" y1="113" x2="451" y2="113"/>
<line opacity="0.1" stroke="#000000" stroke-width="1" x1="50" y1="110" x2="451" y2="110"/>
<line opacity="0.1" stroke="#000000" stroke-width="1" x1="50" y1="107" x2="451" y2="107"/>
<line opacity="0.1" stroke="#000000" stroke-width="1" x1="50" y1="105" x2="451" y2="105"/>
<line opacity="0.1" stroke="#000000" stroke-width="1" x1="50" y1="105" x2="451" y2="105"/>
<line opacity="0.1" stroke="#000000" stroke-width="1" x1="50" y1="90" x2="451" y2="90"/>
<line opacity="0.1" stroke="#000000" stroke-width="1" x1="50" y1="82" x2="451" y2="82"/>
<line opacity="0.1" stroke="#000000" stroke-width="1" x1="50" y1="76" x2="451" y2="76"/>
<line opacity="0.1" stroke="#000000" stroke-width="1" x1="50" y1="71" x2="451" y2="71"/>
<line opacity="0.1" stroke="#000000" stroke-width="1" x1="50" y1="67" x2="451" y2="67"/>
<line opacity="0.1" stroke="#000000" stroke-width="1" x1="50" y1="64" x2="451" y2="64"/>
<line opacity="0.1" stroke="#000000" stroke-width="1" x1="50" y1="61" x2="451" y2="61"/>
<line opacity="0.1" stroke="#000000" stroke-width="1" x1="50" y1="59" x2="451" y2="59"/>
<line opacity="0.1" stroke="#000000" stroke-width="1" x1="50" y1="56" x2="451" y2="56"/>
<line opacity="0.1" stroke="#000000" stroke-width="1" x1="50" y1="56" x2="451" y2="56"/>
<text x="10" y="180" dy="0.76em" text-anchor="middle" font-family="sans-serif" font-size="9.67741935483871" opacity="1" fill="#000000" transform="rotate(270, 10, 180)">
Time (secs)
</text>
<line opacity="0.2" stroke="#000000" stroke-width="1" x1="50" y1="314" x2="50" y2="46"/>
<line opacity="0.2" stroke="#000000" stroke-width="1" x1="130" y1="314" x2="130" y2="46"/>
<line opacity="0.2" stroke="#000000" stroke-width="1" x1="210" y1="314" x2="210" y2="46"/>
<line opacity="0.2" stroke="#000000" stroke-width="1" x1="290" y1="314" x2="290" y2="46"/>
<line opacity="0.2" stroke="#000000" stroke-width="1" x1="370" y1="314" x2="370" y2="46"/>
<line opacity="0.2" stroke="#000000" stroke-width="1" x1="451" y1="314" x2="451" y2="46"/>
<line opacity="0.2" stroke="#000000" stroke-width="1" x1="50" y1="300" x2="451" y2="300"/>
<line opacity="0.2" stroke="#000000" stroke-width="1" x1="50" y1="251" x2="451" y2="251"/>
<line opacity="0.2" stroke="#000000" stroke-width="1" x1="50" y1="202" x2="451" y2="202"/>
<line opacity="0.2" stroke="#000000" stroke-width="1" x1="50" y1="154" x2="451" y2="154"/>
<line opacity="0.2" stroke="#000000" stroke-width="1" x1="50" y1="105" x2="451" y2="105"/>
<line opacity="0.2" stroke="#000000" stroke-width="1" x1="50" y1="56" x2="451" y2="56"/>
<polyline fill="none" opacity="1" stroke="#000000" stroke-width="1" points="49,46 49,314 "/>
<text x="40" y="300" dy="0.5ex" text-anchor="end" font-family="sans-serif" font-size="9.67741935483871" opacity="1" fill="#000000">
0
</text>
<polyline fill="none" opacity="1" stroke="#000000" stroke-width="1" points="44,300 49,300 "/>
<text x="40" y="251" dy="0.5ex" text-anchor="end" font-family="sans-serif" font-size="9.67741935483871" opacity="1" fill="#000000">
0
</text>
<polyline fill="none" opacity="1" stroke="#000000" stroke-width="1" points="44,251 49,251 "/>
<text x="40" y="202" dy="0.5ex" text-anchor="end" font-family="sans-serif" font-size="9.67741935483871" opacity="1" fill="#000000">
0
</text>
<polyline fill="none" opacity="1" stroke="#000000" stroke-width="1" points="44,202 49,202 "/>
<text x="40" y="154" dy="0.5ex" text-anchor="end" font-family="sans-serif" font-size="9.67741935483871" opacity="1" fill="#000000">
1
</text>
<polyline fill="none" opacity="1" stroke="#000000" stroke-width="1" points="44,154 49,154 "/>
<text x="40" y="105" dy="0.5ex" text-anchor="end" font-family="sans-serif" font-size="9.67741935483871" opacity="1" fill="#000000">
10
</text>
<polyline fill="none" opacity="1" stroke="#000000" stroke-width="1" points="44,105 49,105 "/>
<text x="40" y="56" dy="0.5ex" text-anchor="end" font-family="sans-serif" font-size="9.67741935483871" opacity="1" fill="#000000">
100
</text>
<polyline fill="none" opacity="1" stroke="#000000" stroke-width="1" points="44,56 49,56 "/>
<polyline fill="none" opacity="1" stroke="#000000" stroke-width="1" points="50,315 451,315 "/>
<text x="50" y="325" dy="0.76em" text-anchor="middle" font-family="sans-serif" font-size="9.67741935483871" opacity="1" fill="#000000">
0
</text>
<polyline fill="none" opacity="1" stroke="#000000" stroke-width="1" points="50,315 50,320 "/>
<text x="130" y="325" dy="0.76em" text-anchor="middle" font-family="sans-serif" font-size="9.67741935483871" opacity="1" fill="#000000">
1
</text>
<polyline fill="none" opacity="1" stroke="#000000" stroke-width="1" points="130,315 130,320 "/>
<text x="210" y="325" dy="0.76em" text-anchor="middle" font-family="sans-serif" font-size="9.67741935483871" opacity="1" fill="#000000">
2
</text>
<polyline fill="none" opacity="1" stroke="#000000" stroke-width="1" points="210,315 210,320 "/>
<text x="290" y="325" dy="0.76em" text-anchor="middle" font-family="sans-serif" font-size="9.67741935483871" opacity="1" fill="#000000">
3
</text>
<polyline fill="none" opacity="1" stroke="#000000" stroke-width="1" points="290,315 290,320 "/>
<text x="370" y="325" dy="0.76em" text-anchor="middle" font-family="sans-serif" font-size="9.67741935483871" opacity="1" fill="#000000">
4
</text>
<polyline fill="none" opacity="1" stroke="#000000" stroke-width="1" points="370,315 370,320 "/>
<text x="451" y="325" dy="0.76em" text-anchor="middle" font-family="sans-serif" font-size="9.67741935483871" opacity="1" fill="#000000">
5
</text>
<polyline fill="none" opacity="1" stroke="#000000" stroke-width="1" points="451,315 451,320 "/>
<text x="502" y="180" dy="0.76em" text-anchor="middle" font-family="sans-serif" font-size="9.67741935483871" opacity="1" fill="#000000" transform="rotate(90, 502, 180)">
Memory (MB)
</text>
<polyline fill="none" opacity="1" stroke="#000000" stroke-width="1" points="452,46 452,315 "/>
<text x="462" y="315" dy="0.5ex" text-anchor="start" font-family="sans-serif" font-size="9.67741935483871" opacity="1" fill="#000000">
0
</text>
<polyline fill="none" opacity="1" stroke="#000000" stroke-width="1" points="452,315 457,315 "/>
<text x="462" y="275" dy="0.5ex" text-anchor="start" font-family="sans-serif" font-size="9.67741935483871" opacity="1" fill="#000000">
500
</text>
<polyline fill="none" opacity="1" stroke="#000000" stroke-width="1" points="452,275 457,275 "/>
<text x="462" y="234" dy="0.5ex" text-anchor="start" font-family="sans-serif" font-size="9.67741935483871" opacity="1" fill="#000000">
1000
</text>
<polyline fill="none" opacity="1" stroke="#000000" stroke-width="1" points="452,234 457,234 "/>
<text x="462" y="193" dy="0.5ex" text-anchor="start" font-family="sans-serif" font-size="9.67741935483871" opacity="1" fill="#000000">
1500
</text>
<polyline fill="none" opacity="1" stroke="#000000" stroke-width="1" points="452,193 457,193 "/>
<text x="462" y="152" dy="0.5ex" text-anchor="start" font-family="sans-serif" font-size="9.67741935483871" opacity="1" fill="#000000">
2000
</text>
<polyline fill="none" opacity="1" stroke="#000000" stroke-width="1" points="452,152 457,152 "/>
<text x="462" y="111" dy="0.5ex" text-anchor="start" font-family="sans-serif" font-size="9.67741935483871" opacity="1" fill="#000000">
2500
</text>
<polyline fill="none" opacity="1" stroke="#000000" stroke-width="1" points="452,111 457,111 "/>
<text x="462" y="70" dy="0.5ex" text-anchor="start" font-family="sans-serif" font-size="9.67741935483871" opacity="1" fill="#000000">
3000
</text>
<polyline fill="none" opacity="1" stroke="#000000" stroke-width="1" points="452,70 457,70 "/>
<polyline fill="none" opacity="1" stroke="#0000FF" stroke-width="3" points="50,171 130,146 210,136 290,127 370,100 451,81 "/>
<polyline fill="none" opacity="1" stroke="#0000FF" stroke-width="1" points="50,54 130,54 210,54 291,54 371,54 452,48 "/>
<polyline fill="none" opacity="1" stroke="#FFA500" stroke-width="3" points="50,206 130,147 210,116 290,106 370,65 451,47 "/>
<polyline fill="none" opacity="1" stroke="#FFA500" stroke-width="1" points="50,211 130,211 210,211 291,211 371,211 452,211 "/>
<polyline fill="none" opacity="1" stroke="#006400" stroke-width="3" points="50,215 130,184 210,148 290,135 370,95 451,77 "/>
<polyline fill="none" opacity="1" stroke="#006400" stroke-width="1" points="50,314 130,314 210,314 291,314 371,315 452,315 "/>
<polyline fill="none" opacity="1" stroke="#FF0000" stroke-width="3" points="50,211 130,151 210,122 290,107 370,70 451,52 "/>
<polyline fill="none" opacity="1" stroke="#FF0000" stroke-width="1" points="50,298 130,297 210,297 291,297 371,298 452,298 "/>
<rect x="282" y="175" width="165" height="135" opacity="0.5" fill="#DCDCDC" stroke="none"/>
<rect x="282" y="175" width="165" height="135" opacity="1" fill="none" stroke="#000000"/>
<text x="322" y="185" dy="0.76em" text-anchor="start" font-family="sans-serif" font-size="9.67741935483871" opacity="1" fill="#000000">
java-Main time
</text>
<text x="322" y="200" dy="0.76em" text-anchor="start" font-family="sans-serif" font-size="9.67741935483871" opacity="1" fill="#000000">
java-Main memory
</text>
<text x="322" y="215" dy="0.76em" text-anchor="start" font-family="sans-serif" font-size="9.67741935483871" opacity="1" fill="#000000">
sbcl time
</text>
<text x="322" y="230" dy="0.76em" text-anchor="start" font-family="sans-serif" font-size="9.67741935483871" opacity="1" fill="#000000">
sbcl memory
</text>
<text x="322" y="245" dy="0.76em" text-anchor="start" font-family="sans-serif" font-size="9.67741935483871" opacity="1" fill="#000000">
./rust time
</text>
<text x="322" y="260" dy="0.76em" text-anchor="start" font-family="sans-serif" font-size="9.67741935483871" opacity="1" fill="#000000">
./rust memory
</text>
<text x="322" y="275" dy="0.76em" text-anchor="start" font-family="sans-serif" font-size="9.67741935483871" opacity="1" fill="#000000">
src/d/dencoder time
</text>
<text x="322" y="290" dy="0.76em" text-anchor="start" font-family="sans-serif" font-size="9.67741935483871" opacity="1" fill="#000000">
src/d/dencoder memory
</text>
<polyline fill="none" opacity="1" stroke="#0000FF" stroke-width="3" points="292,190 312,190 "/>
<polyline fill="none" opacity="1" stroke="#0000FF" stroke-width="1" points="292,205 312,205 "/>
<polyline fill="none" opacity="1" stroke="#FFA500" stroke-width="3" points="292,220 312,220 "/>
<polyline fill="none" opacity="1" stroke="#FFA500" stroke-width="1" points="292,235 312,235 "/>
<polyline fill="none" opacity="1" stroke="#006400" stroke-width="3" points="292,250 312,250 "/>
<polyline fill="none" opacity="1" stroke="#006400" stroke-width="1" points="292,265 312,265 "/>
<polyline fill="none" opacity="1" stroke="#FF0000" stroke-width="3" points="292,280 312,280 "/>
<polyline fill="none" opacity="1" stroke="#FF0000" stroke-width="1" points="292,295 312,295 "/>
</svg>
@renatoathaydes
Copy link
Author

Raw data:

Benchmarking...
Proc,Run,Memory(bytes),Time(ms)
===> java -Xms20M -Xmx100M -cp build/java Main
java-Main,3190730752,441
java-Main,3194789888,1440
java-Main,3193692160,2316
java-Main,3194720256,3604
java-Main,3192963072,12861
java-Main,3261128704,31282
===> sbcl --script src/lisp/main.fasl
sbcl,1275994112,83
sbcl,1275998208,1396
sbcl,1275998208,5925
sbcl,1275998208,9752
sbcl,1275998208,64811
sbcl,1276006400,153799
===> ./rust
./rust,23138304,56
./rust,23138304,234
./rust,23138304,1288
./rust,23138304,2444
./rust,9027584,15867
./rust,9027584,36985
===> src/d/dencoder
src/d/dencoder,219041792,67
src/d/dencoder,229904384,1114
src/d/dencoder,229904384,4421
src/d/dencoder,229904384,9087
src/d/dencoder,219041792,51315
src/d/dencoder,219041792,120818

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment