Skip to content

Instantly share code, notes, and snippets.

@dockimbel
Last active May 31, 2020 20:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dockimbel/6d72971079a480a555482660677ad97e to your computer and use it in GitHub Desktop.
Save dockimbel/6d72971079a480a555482660677ad97e to your computer and use it in GitHub Desktop.
Red []
bench: function [src [string!]][
bin: to-binary src
recycle
t0: now/time/precise
out: transcode bin
now/time/precise - t0
]
b: make string! s: 1'000'000 * 20
loop 1'000'000 [append b random "abcdefghijk "]
print bench b
; print 1 + bench b ;-- this version crashes interpreter/eval-infix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment