GNU bug report logs -
#50456
Optimise bytevector->nix-base32-string and bytevector->base16-string.
Previous Next
Full log
Message #20 received at 50456 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Hi,
Here are the test results using (ice-9 time) with
the attached "time.scm" and guix/base16.scm,
to be run with ‘make && ./pre-inst-env guix repl time.scm’:
old:
clock utime stime cutime cstime gctime
3.93 6.32 0.03 0.00 0.00 3.59
clock utime stime cutime cstime gctime
3.92 6.32 0.03 0.00 0.00 3.59
clock utime stime cutime cstime gctime
3.86 6.24 0.02 0.00 0.00 3.54
new:
clock utime stime cutime cstime gctime
2.43 3.60 0.02 0.00 0.00 1.76
clock utime stime cutime cstime gctime
2.49 3.67 0.01 0.00 0.00 1.77
clock utime stime cutime cstime gctime
2.64 3.77 0.01 0.00 0.00 1.77
About half as much time is spent in GC.
The ‘utime’ is also half as much. Not sure
what ‘clock’ means exactly, but it is reduced
as well.
Greetings,
Maxime
[time.scm (text/x-scheme, inline)]
(define bv #vu8(95 120 195 50 116 227 63 169 222 86 89 38 92 145 126 37 192 55 34))
(define (the-test p)
(let loop ((n 0))
(when (< n #e1e6)
(p bv)
(loop (+ n 1)))))
(display "old:\n")
;; Warm up the JIT
(the-test (@ (guix base16) bytevector->base16-string/old))
;; And time the procedure
((@ (ice-9 time) time) (the-test (@ (guix base16) bytevector->base16-string/old)))
((@ (ice-9 time) time) (the-test (@ (guix base16) bytevector->base16-string/old)))
((@ (ice-9 time) time) (the-test (@ (guix base16) bytevector->base16-string/old)))
(display "new:\n")
;; Warm up the JIT
(the-test (@ (guix base16) bytevector->base16-string))
;; And time the procedure
((@ (ice-9 time) time) (the-test (@ (guix base16) bytevector->base16-string)))
((@ (ice-9 time) time) (the-test (@ (guix base16) bytevector->base16-string)))
((@ (ice-9 time) time) (the-test (@ (guix base16) bytevector->base16-string)))
[base16.scm (text/x-scheme, attachment)]
[signature.asc (application/pgp-signature, inline)]
This bug report was last modified 3 years and 316 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.