1
0
forked from Mirror/wren
Files
wren/test/api/value.wren
Bob Nystrom 01e8f9053e Add a benchmark to test the Wren C API.
I've got some ideas on how to tweak the embedding API, but I want to
see what performance impact they have first, so this adds a little
benchmark that just calls a foreign method a ton of times.
2015-12-15 16:02:13 -08:00

15 lines
303 B
Plaintext

class Value {
foreign static value=(value)
foreign static value
}
Value.value = ["list", "of", "strings"]
// Do some stuff to trigger a GC (at least when GC stress testing enabled).
var s = "string"
for (i in 1...10) {
s = s + " more"
}
System.print(Value.value) // expect: [list, of, strings]