from threading import Thread
import time
class Counter():
def __init__(self):
self._counter = 0
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
commit be741bcbc978520403c401b6ab6d2196ebe7971d | |
Author: Mark Shannon <[email protected]> | |
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import timeit | |
import sys | |
def foo(): | |
for i in range(100_000): | |
if i == 50_000: | |
pass # Put breakpoint here | |
print("No debug") | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: |
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 |
logging_silent | 279 ns | 167 ns: 1.67x 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 |
logging_silent | 163 ns | 157 ns: 1.04x faster |
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 |
scimark_lu | 185 ms | 179 ms: 1.03x faster |
NewerOlder