Brython 3.8.9 performance compared to CPython 3.8.0

User agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:76.0) Gecko/20100101 Firefox/76.0

Test Brython (100 = CPython) Code
simple assignment66
  1. for i in range(1000000):
  2. a = 1
augmented assignment77
  1. a = 0
  2. for i in range(1000000):
  3. a += 1
simple assignment to float184
  1. for i in range(1000000):
  2. a = 1.0
big integers3659
  1. for i in range(100):
  2. 2 60
build dictionary318
  1. for i in range(1000000):
  2. a = {0: 0}
build dictionary 2143
  1. d = {}
  2. for i in range(100000):
  3. d[i] = i
set dictionary item132
  1. a = {0: 0}
  2. for i in range(1000000):
  3. a[0] = i
build set625
  1. for i in range(1000000):
  2. a = {0, 2.7, "x"}
build list71
  1. for i in range(1000000):
  2. a = [1, 2, 3]
set list item98
  1. a = [0]
  2. for i in range(1000000):
  3. a[0] = i
integer addition196
  1. a, b, c = 1, 2, 3
  2. for i in range(1000000):
  3. a + b + c
string addition142
  1. a, b, c = 'a', 'b', 'c'
  2. for i in range(1000000):
  3. a + b + c
cast int to string127
  1. for i in range(100000):
  2. str(i)
create function without arguments446
  1. for i in range(1000000):
  2. def f():
  3. pass
create function, single positional argument464
  1. for i in range(1000000):
  2. def f(x):
  3. pass
create function, complex arguments655
  1. for i in range(1000000):
  2. def f(x, y=1, *args, kw):
  3. pass
function call804
  1. def f(x):
  2. return x
  3. for i in range(1000000):
  4. f(i)
function call, complex arguments1234
  1. def f(x, y=0, args, *kw):
  2. return x
  3. for i in range(100000):
  4. f(i, 5, 6, a=8)
create simple class498
  1. for i in range(10000):
  2. class A:
  3. pass
create class with init572
  1. for i in range(10000):
  2. class A:
  3. def init(self, x):
  4. self.x = x
create instance of simple class241
  1. class A:
  2. pass
  3.  
  4. for i in range(1000000):
  5. A()
create instance of class with init1123
  1. class A:
  2. def init(self, x):
  3. self.x = x
  4.  
  5. for i in range(100000):
  6. A(i)
call instance method2551
  1. class A:
  2. def init(self, x):
  3. self.x = x
  4.  
  5. def f(self):
  6. return self.x
  7.  
  8. a = A(1)
  9. for i in range(100000):
  10. a.f()