Logo
Explore Mail Help
Register Sign In
Mirror/wren
1
0
Fork 1
You've already forked wren
mirror of https://github.com/wren-lang/wren.git synced 2026-01-11 22:28:45 +01:00
Code Issues Packages Projects Releases Wiki Activity
Files
dfe65305c3e660510e2817e6a4a01f29cc6b4fbd
wren/benchmark/fib.wren

11 lines
208 B
Plaintext
Raw Normal View History

Convert all fns to block arg syntax.
2014-04-02 19:41:53 -07:00
var fib = new Fn {|n|
Make null falsey.
2014-01-20 18:12:55 -08:00
if (n < 2) return n
Fix up benchmarks and add method call one.
2013-12-07 18:43:39 -08:00
return fib.call(n - 1) + fib.call(n - 2)
Add trivial fib benchmark.
2013-11-14 20:57:56 -08:00
}
Move clock into IO.
2014-02-04 08:49:16 -08:00
var start = IO.clock
Range operators! Added ".." and "..." infix operators. Num implements them to return Range objects. Those in turn implement the iterator protocol, so now numeric for loops are easy: for (i in 1..10) { ... } I also cleaned up the Wren benchmarks to use this. In the process, I discovered the method_call benchmark really just showed loop peformance, so I unrolled the loops in all of the languages to stress method calls.
2013-12-25 15:01:45 -08:00
for (i in 1..5) {
Clean up text handling a bit: - Rename IO.write -> IO.print. - Make IO.write not print a newline. - Support \u Unicode escapes in strings.
2014-01-05 12:27:12 -08:00
IO.print(fib.call(28))
Get a basic benchmark runner going.
2013-11-22 08:55:22 -08:00
}
Move clock into IO.
2014-02-04 08:49:16 -08:00
IO.print("elapsed: " + (IO.clock - start).toString)
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.0 Page: 1077ms Template: 109ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API