Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add LOAD_NONE #29

Closed
wants to merge 0 commits into from
Closed

add LOAD_NONE #29

wants to merge 0 commits into from

Conversation

iritkatriel
Copy link
Owner

@iritkatriel iritkatriel commented Sep 10, 2021

Old:

iritkatriel@Irits-MBP cpython-1 % ./python.exe -c "import dis; dis.dis('x=None')"
  1           0 LOAD_CONST               0 (None)
              2 STORE_NAME               0 (x)
              4 LOAD_CONST               0 (None)
              6 RETURN_VALUE
iritkatriel@Irits-MBP cpython-1 % repeat 5 ./python.exe -m timeit "x = None"     
20000000 loops, best of 5: 15.1 nsec per loop
20000000 loops, best of 5: 15.1 nsec per loop
20000000 loops, best of 5: 15.1 nsec per loop
20000000 loops, best of 5: 15.3 nsec per loop
20000000 loops, best of 5: 15.1 nsec per loop

New:

iritkatriel@Irits-MBP cpython % ./python.exe -c "import dis; dis.dis('x=None')"
  1           0 LOAD_NONE
              2 STORE_NAME               0 (x)
              4 LOAD_NONE
              6 RETURN_VALUE
iritkatriel@Irits-MBP cpython % repeat 5 ./python.exe -m timeit "x = None"     
20000000 loops, best of 5: 14.9 nsec per loop
20000000 loops, best of 5: 14.9 nsec per loop
20000000 loops, best of 5: 14.8 nsec per loop
20000000 loops, best of 5: 14.8 nsec per loop
20000000 loops, best of 5: 14.8 nsec per loop

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant