|
From: | Paul Eggert |
Subject: | Re: i18n/l10n summary |
Date: | Sun, 4 Jun 2017 11:37:46 -0700 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 |
Eli Zaretskii wrote:
Would it make sense to start collecting all those benchmarks, e.g. somewhere under test/, so that in due time we will have a sound body of code
I wouldn't collect microbenchmarks just for the sake of collecting them. They're flaky, and the overhead of collecting them and maintaining the collection is likely greater than any future benefit of having them around. If we want to have a performance testsuite our main problem is building and supporting its infrastructure, not coming up with examples.
If you're interested despite the above disclaimer, here's what I used: (defun bench-with (n) (let ((start (float-time (get-internal-run-time))) (i 0)) (while (< i n) (format "%d %s %c" 3 "def" ?‘) (setq i (1+ i))) (- (float-time (get-internal-run-time)) start))) (defun bench-without (n) (let ((start (float-time (get-internal-run-time))) (i 0)) (while (< i n) (setq i (1+ i))) (- (float-time (get-internal-run-time)) start))) (defun bench (n) (- (bench-with n) (bench-without n)))
[Prev in Thread] | Current Thread | [Next in Thread] |