From 2643ecc6464722467f217e6c7f68a5433f25325b Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Wed, 19 Sep 2012 09:56:24 -0700 Subject: [PATCH] benchmark.unicode: add benchmark for unicode case conversions. --- extra/benchmark/unicode/unicode.factor | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 extra/benchmark/unicode/unicode.factor diff --git a/extra/benchmark/unicode/unicode.factor b/extra/benchmark/unicode/unicode.factor new file mode 100644 index 0000000000..8b793f8fe1 --- /dev/null +++ b/extra/benchmark/unicode/unicode.factor @@ -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