Commit 3af22f92 authored by Raymond Toy's avatar Raymond Toy

Add some timing code, but not for tests.

parent e6b95b82
Pipeline #301 failed with stage
in 17 minutes and 56 seconds
......@@ -24,3 +24,33 @@
(prod-knuth (bignum::classical-multiply-bignums r1 r2))
(prod-hd (bignum::classical-multiply-bignum-hd r1 r2)))
(assert-equal prod-knuth prod-hd r1 r2))))))
;; Just for simple timing tests so we can redo the timing tests if needed.
(define-test hd-timing
"Test execution time"
(:tag :bignum-tests)
(let ((rng (kernel::make-random-object :state
:rand 0 :cached-p nil))
(range (ash 1 128))
(reps 10000))
(flet ((gen-bignum (x sign)
(do ((r (random x rng) (random x rng)))
((typep r 'bignum)
(if (zerop sign)
r (- r))))))
(let* ((r1 (gen-bignum range 1))
(r2 (gen-bignum range 1)) res)
(dotimes (k reps)
(declare (fixnum k)) (setf res
(bignum::classical-multiply-bignums r1 r2))))
(print res)
(dotimes (k reps)
(declare (fixnum k)) (setf res
(bignum::classical-multiply-bignum-hd r1 r2))))
(print res)))))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment