Skip to content

Instantly share code, notes, and snippets.

commit be741bcbc978520403c401b6ab6d2196ebe7971d
Author: Mark Shannon <mark@hotpy.org>
Date: Thu Nov 16 10:49:06 2023 +0000
Reorganize code gen
diff --git a/Python/generated_cases.c.h b/Python/generated_cases.c.h
index 587efc9268a..dcc2cb05ac9 100644
--- a/Python/generated_cases.c.h
+++ b/Python/generated_cases.c.h
op(_BINARY_OP_ADD_INT, (unused/1, left, right -- res)) {
if (IS_CONST(left) && IS_CONST(right)) {
res = MAKE_CONST(Py_NumberAdd(left->value, right->value));
emit(_LOAD_CONST_INLINE, res->value);
}
else {
res = UNKNOWN();
emit(_BINARY_OP_ADD_INT);
}
Py_DECREF(left);
import timeit
import sys
def foo():
for i in range(100_000):
if i == 50_000:
pass # Put breakpoint here
print("No debug")
class CallsLeave:
def __init__(self, cls, obj):
self.cls = cls
self.obj = obj
def __call__(self, exc, val, tb):
self.cls.__leave__(self.obj, val)
class CallsLeaveDescriptor:

Results vs. base

  • fork: carljm
  • ref: inlinecomp2
  • machine: linux-x86_64
  • commit hash: 36b2917
  • commit date: 2023-02-10
  • overall geometric mean: 1.00x faster

Results vs. base

  • fork: Fidget_Spinner
  • ref: per_class_cache
  • machine: linux-x86_64
  • commit hash: 78c9301
  • commit date: 2023-01-09
  • overall geometric mean: 1.01x slower
Benchmark 2022-12-02_10-13-3.10-b027dd78bbdb 2022-12-01_13-07-3.11-9707bf228e00
deltablue 12.4 ms 6.44 ms: 1.92x faster
scimark_sor 329 ms 196 ms: 1.68x faster
logging_silent 279 ns 167 ns: 1.67x faster
go 378 ms 232 ms: 1.63x faster
Benchmark 2022-09-13_08-28-main-49cceeb5c998 2022-10-23_09-32-for-iter-no-pop-d5dd9b40545f
unpack_sequence 81.0 ns 74.9 ns: 1.08x faster
scimark_sor 196 ms 187 ms: 1.05x faster
logging_silent 163 ns 157 ns: 1.04x faster
scima
Benchmark 2022-10-21_13-41-main-82ccbf69a842 2022-10-21_15-10-code-version-004b13250ff2
unpack_sequence 78.4 ns 73.5 ns: 1.07x faster
unpickle 23.0 us 21.6 us: 1.06x faster
scimark_lu 185 ms 179 ms: 1.03x faster
hexiom 10.2 m
Benchmark 2022-10-19_14-49-main-1a6bacb31f7b 2022-10-20_12-51-entry-frame-10b03c868810
nbody 156 ms 150 ms: 1.04x faster
pickle 17.7 us 17.1 us: 1.04x faster
scimark_fft 538 ms 524 ms: 1.03x faster
scimark_sparse_mat_mult 6.71 ms