Skip to content
This repository has been archived by the owner. It is now read-only.

Keep modules as locals when possible #839

Merged
merged 21 commits into from Jul 4, 2018
Merged

Conversation

@patiences
Copy link
Contributor

@patiences patiences commented Jun 15, 2018

No description provided.

@patiences
Copy link
Contributor Author

@patiences patiences commented Jun 18, 2018

Benchmarking test for loading global variables here. Some stats at this point:

Without optimization

Running test_loads
  Elapsed time:  61.447008085029665  sec
  CPU process time:  10.024515999999998  sec
Running test_loads
  Elapsed time:  61.878539645986166  sec
  CPU process time:  9.702131999999999  sec
Running test_loads
  Elapsed time:  61.865173934958875  sec
  CPU process time:  9.656627  sec
Running test_loads
  Elapsed time:  62.24996647500666  sec
  CPU process time:  9.936633  sec

With optimization

Running test_loads
  Elapsed time:  36.743622453010175  sec
  CPU process time:  8.90975  sec
Running test_loads
  Elapsed time:  38.39133337204112  sec
  CPU process time:  9.475329  sec
Running test_loads
  Elapsed time:  37.19154859299306  sec
  CPU process time:  8.950337999999999  sec
Running test_loads
  Elapsed time:  36.41155601700302  sec
  CPU process time:  8.750753  sec

@patiences
Copy link
Contributor Author

@patiences patiences commented Jun 18, 2018

Test for class variables here. More numbers for class variable optimizations:

Without optimization

Running test_class_var_load
  Elapsed time:  41.99330894899322  sec
  CPU process time:  7.8091740000000005  sec
Running test_class_var_load
  Elapsed time:  42.89765899197664  sec
  CPU process time:  7.820375  sec
Running test_class_var_load
  Elapsed time:  42.63216649304377  sec
  CPU process time:  7.784223999999999  sec
Running test_class_var_load
  Elapsed time:  44.22583248699084  sec
  CPU process time:  8.168614  sec

With optimization

Running test_class_var_load
  Elapsed time:  31.45843087998219  sec
  CPU process time:  7.383700999999999  sec
Running test_class_var_load
  Elapsed time:  33.663975150033366  sec
  CPU process time:  8.229892000000001  sec
Running test_class_var_load
  Elapsed time:  33.1333520799526  sec
  CPU process time:  7.8959220000000006  sec
Running test_class_var_load
  Elapsed time:  33.31698497297475  sec
  CPU process time:  7.602885  sec

@patiences patiences changed the title [WIP] Keep modules as locals when possible Keep modules as locals when possible Jun 19, 2018
@patiences
Copy link
Contributor Author

@patiences patiences commented Jun 21, 2018

Test for local variables in functions here. Results:

Without optimization

Running test_function_var_load
  Elapsed time:  48.14083131996449  sec
  CPU process time:  8.56604  sec
Running test_function_var_load
  Elapsed time:  49.171420827973634  sec
  CPU process time:  9.235756  sec
Running test_function_var_load
  Elapsed time:  49.861631328007206  sec
  CPU process time:  8.593879  sec
Running test_function_var_load
  Elapsed time:  47.639647322008386  sec
  CPU process time:  8.714212000000002  sec

With optimization

Running test_function_var_load
  Elapsed time:  36.17214421299286  sec
  CPU process time:  8.87889  sec
Running test_function_var_load
  Elapsed time:  38.027088380011264  sec
  CPU process time:  8.931876  sec
Running test_function_var_load
  Elapsed time:  38.70553471700987  sec
  CPU process time:  9.243238  sec
Running test_function_var_load
  Elapsed time:  38.75832613901002  sec
  CPU process time:  9.411923999999999  sec

Copy link
Member

@freakboy3742 freakboy3742 left a comment

👍

@freakboy3742 freakboy3742 merged commit 1b03783 into beeware:master Jul 4, 2018
5 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants