]> gitweb.factorcode.org Git - factor.git/blob - extra/benchmark/unicode/unicode.factor
8b793f8fe19306293a4b02263f4d0482e7cc57e7
[factor.git] / extra / benchmark / unicode / unicode.factor
1 ! Copyright (C) 2012 John Benediktsson
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: kernel math random sequences strings unicode.case ;
4 IN: benchmark.unicode
5
6 : crazy-unicode-string ( -- string )
7     8 [ 8 0xffff random-integers ] replicate " " join ;
8
9 : unicode-benchmark ( -- )
10     crazy-unicode-string 8 [
11         [ >title ] [ >lower ] [ >upper ] tri 3append
12         ! [ >lower ] [ >upper ] bi append
13     ] times drop ;
14
15 MAIN: unicode-benchmark