Skip to content

Instantly share code, notes, and snippets.

View jdemeyer's full-sized avatar

Jeroen Demeyer jdemeyer

  • Be-Mobile
  • Gent, Belgium
View GitHub Profile
from __future__ import print_function, division
from sage.all import ZZ, Mod, Matrix
from sage.modules.free_module_integer import IntegerLattice
ZZx = ZZ['x']
def hex(n):
return "0x" + ZZ(n).str(16)
Micro-benchmark results for PEP 580.
See https://github.com/jdemeyer/callbench for benchmarking code
CPython was configured with --enable-optimizations and compiled with GCC 6.4.0.
CPython 1fc5bf2ff PEP 580 1fc5bf2ff PEP 590 2f54908af
VARARGS function(): 24.5 ns +- 0.1 ns 24.7 ns +- 0.2 ns 25.9 ns +- 0.4 ns
FASTCALL function(): 19.3 ns +- 0.9 ns 17.3 ns +- 0.2 ns 19.4 ns +- 0.4 ns
VARARGS obj.method(): 41.9 ns +- 0.2 ns 41.3 ns +- 0.8 ns 42.1 ns +- 0.8 ns