We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c35c735 commit b2fb5ecCopy full SHA for b2fb5ec
Tools/ftscalingbench/ftscalingbench.py
@@ -27,6 +27,7 @@
27
import sys
28
import threading
29
import time
30
+import copy
31
32
# The iterations in individual benchmarks are scaled by this factor.
33
WORK_SCALE = 100
@@ -37,11 +38,25 @@
37
38
in_queues = []
39
out_queues = []
40
-
41
def register_benchmark(func):
42
ALL_BENCHMARKS[func.__name__] = func
43
return func
44
45
+
46
+@register_benchmark
47
+def shallow_copy():
48
+ x = [1, 2, 3]
49
+ shallow_copy = copy.copy
50
+ for i in range(200 * WORK_SCALE):
51
+ shallow_copy(x)
52
53
54
+def deepcopy():
55
+ x = {'list': [1, 2], 'tuple': (1, None)}
56
+ deepcopy = copy.deepcopy
57
+ for i in range(40 * WORK_SCALE):
58
+ deepcopy(x)
59
60
@register_benchmark
61
def object_cfunction():
62
accu = 0
0 commit comments