benchmark.unicode: add benchmark for unicode case conversions.

db4
John Benediktsson 2012-09-19 09:56:24 -07:00
parent de52d96d93
commit 2643ecc646
1 changed files with 15 additions and 0 deletions

View File

@ -0,0 +1,15 @@
! Copyright (C) 2012 John Benediktsson
! See http://factorcode.org/license.txt for BSD license.
USING: kernel math random sequences strings unicode.case ;
IN: benchmark.unicode
: crazy-unicode-string ( -- string )
8 [ 8 0xffff random-integers ] replicate " " join ;
: unicode-benchmark ( -- )
crazy-unicode-string 8 [
[ >title ] [ >lower ] [ >upper ] tri 3append
! [ >lower ] [ >upper ] bi append
] times drop ;
MAIN: unicode-benchmark