Commit 77726cb1 authored by Kevin Modzelewski's avatar Kevin Modzelewski

Simple runtime-only benchmark

create 100M ints and free them periodically
timing for refcounting:
free them every 100 ints: 2.79s
free them every 10k ints: 6.660s
parent be8fad9d
......@@ -4224,6 +4224,16 @@ void setupRuntime() {
TRACK_ALLOCATIONS = true;
Box* l = NULL;
for (int i = 0; i < 100000000; i++) {
if (i % 100 == 0) {
Py_XDECREF(l);
l = PyList_New(0);
}
PyList_Append(l, autoDecref(boxInt(i)));
}
Py_XDECREF(l);
// XXX
PyGC_Collect(); // To make sure it creates any static objects
IN_SHUTDOWN = true;
......
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