Skip to content

Instantly share code, notes, and snippets.

@zoffixznet

zoffixznet/p6.p6 Secret

Created September 26, 2017 17:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zoffixznet/8d4296b6a8caf089319475a1dc7a43b3 to your computer and use it in GitHub Desktop.
Save zoffixznet/8d4296b6a8caf089319475a1dc7a43b3 to your computer and use it in GitHub Desktop.
use Test;
subtest 'performance of ≤, ≥, ≠ compared to Texas versions' => {
sub measure (&code) { code for ^300; with now { code for ^100_000; now - $_ } }
is-approx { rand ≤ rand }.&measure, { rand <= rand }.&measure, '≤', :rel-tol<.5>;
is-approx { rand ≥ rand }.&measure, { rand >= rand }.&measure, '≥', :rel-tol<.5>;
is-approx { rand ≠ rand }.&measure, { rand != rand }.&measure, '≠', :rel-tol<.5>;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment