[racket-dev] Performance: bytes->string/locale
Tested on Racket 6.0.1
----
(define str (string->bytes/locale "abcdefghабвгде"))
(time
(for ([i 1000000])
(bytes->string/locale str)))
(time
(for ([i 1000000])
(bytes->string/utf-8 str)))
---- Windows 7 x32:
> (enter! "test.rkt")
cpu time: 859 real time: 908 gc time: 78
cpu time: 641 real time: 667 gc time: 16 Seems OK
Linux
$ uname -a
Linux veles 3.14-1-686-pae #1 SMP Debian 3.14.12-1 (2014-07-11) i686 GNU/Linux
$ /usr/racket/bin/racket
Welcome to Racket v6.0.1.
> (enter! "test.rkt")
cpu time: 3072 real time: 3075 gc time: 52
cpu time: 552 real time: 551 gc time: 8 Locale in both cases utf-8, so bytes->string/utf-8 and bytes->string/locale returns the same, but bytes->string/locale in Linux 6 times slower.
Is it fixable?
--
Roman Klochkov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/dev/archive/attachments/20140802/b6d60396/attachment.html>