Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
..
Failed to load latest commit information.
README.md
api_call.wren
api_foreign_method.wren
binary_trees.dart
binary_trees.lua
binary_trees.py
binary_trees.rb
binary_trees.wren
binary_trees_gc.wren
delta_blue.dart
delta_blue.lua.inprogress
delta_blue.py
delta_blue.wren
fannkuch.lua
fannkuch.py
fannkuch.rb
fib.dart
fib.lua
fib.py
fib.rb
fib.wren
fibers.wren
for.dart
for.lua
for.py
for.rb
for.wren
map_numeric.dart.skip
map_numeric.lua
map_numeric.py
map_numeric.rb
map_numeric.wren
map_string.lua
map_string.py
map_string.rb
map_string.wren
method_call.dart
method_call.lua
method_call.py
method_call.rb
method_call.wren
string_equals.py
string_equals.wren

README.md

The benchmarks in here attempt to faithfully implement the exact same algorithm in a few different languages. We're using Lua, Python, and Ruby for comparison here because those are all in Wren's ballpark: dynamically-typed, object-oriented, bytecode-compiled.

A bit about each benchmark:

binary_trees

This benchmark stresses object creation and garbage collection. It builds a few big, deeply nested binaries and then traverses them.

fib

This is just a simple naïve Fibonacci number calculator. It was the first benchmark I wrote when Wren supported little more than function calls and arithmetic. It isn't particularly representative of real-world code, but it does stress function call and arithmetic.

for

This microbenchmark just tests the performance of for loops. Not too useful, but i used it when implementing for in Wren to make sure it wasn't too far off the mark.

method_call

This is the most useful benchmark: it tests dynamic dispatch and polymorphism. You'll note that the main iteration loop is unrolled in all of the implementations. This is to ensure that the loop overhead itself doesn't dwarf the method call time.