Looks like the speed difference is still there for ascii.
> (benchmark-sbcl-octets-to-string-ascii) REAL-TIME-MS 116 USER-RUN-TIME-US 110983 SYSTEM-RUN-TIME-US 3999 GC-RUN-TIME-MS 20 PROCESSOR-CYCLES 277290837 BYTES-CONSED 20771984
> (benchmark-fs-octets-to-string-ascii) REAL-TIME-MS 27 USER-RUN-TIME-US 25996 SYSTEM-RUN-TIME-US 1000 GC-RUN-TIME-MS 0 PROCESSOR-CYCLES 63543294 BYTES-CONSED 4016384
> (benchmark-sbcl-octets-to-string-utf8) REAL-TIME-MS 108 USER-RUN-TIME-US 98985 SYSTEM-RUN-TIME-US 7999 GC-RUN-TIME-MS 10 PROCESSOR-CYCLES 259652187 BYTES-CONSED 20770832
> (benchmark-fs-octets-to-string-utf8) REAL-TIME-MS 38 USER-RUN-TIME-US 33994 SYSTEM-RUN-TIME-US 2000 GC-RUN-TIME-MS 0 PROCESSOR-CYCLES 90630252 BYTES-CONSED 4008128
(defparameter *sample-octets* (coerce (iter (for i from 1 to 1000000) (collect (random 128))) '(vector (unsigned-byte 8))))
(define-benchmark sbcl-octets-to-string-ascii (sb-ext:octets-to-string *sample-octets* :external-format :ascii))
(define-benchmark fs-octets-to-string-ascii (flexi-streams:octets-to-string *sample-octets* :external-format :ascii))
(define-benchmark sbcl-octets-to-string-utf8 (sb-ext:octets-to-string *sample-octets* :external-format :utf8))
(define-benchmark fs-octets-to-string-utf8 (flexi-streams:octets-to-string *sample-octets* :external-format :utf8))
Looks like the speed difference is still there for ascii.
> (benchmark- sbcl-octets- to-string- ascii)
REAL-TIME-MS 116
USER-RUN-TIME-US 110983
SYSTEM-RUN-TIME-US 3999
GC-RUN-TIME-MS 20
PROCESSOR-CYCLES 277290837
BYTES-CONSED 20771984
> (benchmark- fs-octets- to-string- ascii)
REAL-TIME-MS 27
USER-RUN-TIME-US 25996
SYSTEM-RUN-TIME-US 1000
GC-RUN-TIME-MS 0
PROCESSOR-CYCLES 63543294
BYTES-CONSED 4016384
> (benchmark- sbcl-octets- to-string- utf8)
REAL-TIME-MS 108
USER-RUN-TIME-US 98985
SYSTEM-RUN-TIME-US 7999
GC-RUN-TIME-MS 10
PROCESSOR-CYCLES 259652187
BYTES-CONSED 20770832
> (benchmark- fs-octets- to-string- utf8)
REAL-TIME-MS 38
USER-RUN-TIME-US 33994
SYSTEM-RUN-TIME-US 2000
GC-RUN-TIME-MS 0
PROCESSOR-CYCLES 90630252
BYTES-CONSED 4008128
(defparameter *sample-octets*
(coerce
(iter (for i from 1 to 1000000)
(collect (random 128)))
'(vector (unsigned-byte 8))))
(define-benchmark sbcl-octets- to-string- ascii octets- to-string *sample-octets* :external-format :ascii))
(sb-ext:
(define-benchmark fs-octets- to-string- ascii streams: octets- to-string *sample-octets* :external-format :ascii))
(flexi-
(define-benchmark sbcl-octets- to-string- utf8 octets- to-string *sample-octets* :external-format :utf8))
(sb-ext:
(define-benchmark fs-octets- to-string- utf8 streams: octets- to-string *sample-octets* :external-format :utf8))
(flexi-