Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
README.md
api_call.wren
api_foreign_method.wren Add a benchmark to test the Wren C API. Dec 16, 2015
binary_trees.dart Add some Dart benchmarks running on fletch. Dec 5, 2015
binary_trees.lua Reorganize tests and benchmark scripts. Mar 14, 2015
binary_trees.py
binary_trees.rb
binary_trees.wren
binary_trees_gc.wren
delta_blue.dart
delta_blue.lua.inprogress Reorganize tests and benchmark scripts. Mar 14, 2015
delta_blue.py
delta_blue.wren Make delta_blue more idiomatic Wren. Dec 1, 2015
fannkuch.lua
fannkuch.py Reorganize tests and benchmark scripts. Mar 14, 2015
fannkuch.rb Reorganize tests and benchmark scripts. Mar 14, 2015
fib.dart
fib.lua
fib.py Reorganize tests and benchmark scripts. Mar 14, 2015
fib.rb Reorganize tests and benchmark scripts. Mar 14, 2015
fib.wren
fibers.wren Fix typo in benchmark. Dec 15, 2015
for.dart
for.lua
for.py
for.rb
for.wren Simple string interpolation. Nov 11, 2015
map_numeric.dart.skip Add some Dart benchmarks running on fletch. Dec 5, 2015
map_numeric.lua
map_numeric.py Reorganize tests and benchmark scripts. Mar 14, 2015
map_numeric.rb Reorganize tests and benchmark scripts. Mar 14, 2015
map_numeric.wren Simple string interpolation. Nov 11, 2015
map_string.lua
map_string.py
map_string.rb
map_string.wren
method_call.dart Add some Dart benchmarks running on fletch. Dec 5, 2015
method_call.lua Reorganize tests and benchmark scripts. Mar 14, 2015
method_call.py
method_call.rb Reorganize tests and benchmark scripts. Mar 14, 2015
method_call.wren Simple string interpolation. Nov 11, 2015
string_equals.py
string_equals.wren Simple string interpolation. Nov 11, 2015

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.