Try to make the benchmark suite more fair on instance variables

This commit is contained in:
K. Lange 2021-04-17 19:32:02 +09:00
parent 444cb28d06
commit 391ee73d48
2 changed files with 15 additions and 10 deletions

View File

@ -39,18 +39,20 @@ def read_builtin():
oct; oct; oct; oct; oct
oct; oct; oct; oct; oct
_A.x = 1
def read_classvar():
let A = _A
A.x = 1
A.x; A.x; A.x; A.x; A.x
A.x; A.x; A.x; A.x; A.x
A.x; A.x; A.x; A.x; A.x
A.x; A.x; A.x; A.x; A.x
A.x; A.x; A.x; A.x; A.x
let _a = _A()
_a.x = 1
def read_instancevar():
let a = _A()
a.x = 1
let a = _a
a.x; a.x; a.x; a.x; a.x
a.x; a.x; a.x; a.x; a.x
a.x; a.x; a.x; a.x; a.x
@ -66,7 +68,7 @@ def read_unboundmethod():
A.m; A.m; A.m; A.m; A.m
def read_boundmethod():
let a = _A()
let a = _a
a.m; a.m; a.m; a.m; a.m
a.m; a.m; a.m; a.m; a.m
a.m; a.m; a.m; a.m; a.m
@ -109,7 +111,7 @@ def write_classvar():
A.x = 1; A.x = 1; A.x = 1; A.x = 1; A.x = 1
def write_instancevar():
let a = _A()
let a = _a
a.x = 1; a.x = 1; a.x = 1; a.x = 1; a.x = 1
a.x = 1; a.x = 1; a.x = 1; a.x = 1; a.x = 1
a.x = 1; a.x = 1; a.x = 1; a.x = 1; a.x = 1

View File

@ -40,18 +40,21 @@ def read_builtin():
oct; oct; oct; oct; oct
oct; oct; oct; oct; oct
_A.x = 1
def read_classvar():
A = _A
A.x = 1
A.x; A.x; A.x; A.x; A.x
A.x; A.x; A.x; A.x; A.x
A.x; A.x; A.x; A.x; A.x
A.x; A.x; A.x; A.x; A.x
A.x; A.x; A.x; A.x; A.x
_a = _A()
_a.x = 1
def read_instancevar():
a = _A()
a.x = 1
a = _a
a.x; a.x; a.x; a.x; a.x
a.x; a.x; a.x; a.x; a.x
a.x; a.x; a.x; a.x; a.x
@ -67,7 +70,7 @@ def read_unboundmethod():
A.m; A.m; A.m; A.m; A.m
def read_boundmethod():
a = _A()
a = _a
a.m; a.m; a.m; a.m; a.m
a.m; a.m; a.m; a.m; a.m
a.m; a.m; a.m; a.m; a.m
@ -112,7 +115,7 @@ def write_classvar():
A.x = 1; A.x = 1; A.x = 1; A.x = 1; A.x = 1
def write_instancevar():
a = _A()
a = _a
a.x = 1; a.x = 1; a.x = 1; a.x = 1; a.x = 1
a.x = 1; a.x = 1; a.x = 1; a.x = 1; a.x = 1
a.x = 1; a.x = 1; a.x = 1; a.x = 1; a.x = 1