Commit f903d98
authored
Add @functools.lru_cache decorator for get_binding_version() (#512)
>>> 35.381859/0.004149
8527.804049168473
$ git stash
$ python test_slowness.py 100000
driver.cuDriverGetVersion() 12060
cuda_utils.get_binding_version() (12, 8)
driver.cuDriverGetVersion()
0.023946 seconds for 100000 iterations
0.24 µs per call
cuda_utils.get_binding_version()
35.381859 seconds for 100000 iterations
353.82 µs per call
$ git stash pop
$ python test_slowness.py 100000
driver.cuDriverGetVersion() 12060
cuda_utils.get_binding_version() (12, 8)
driver.cuDriverGetVersion()
0.022644 seconds for 100000 iterations
0.23 µs per call
cuda_utils.get_binding_version()
0.004149 seconds for 100000 iterations
0.04 µs per call1 parent 8cda903 commit f903d98
1 file changed
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
182 | 182 | | |
183 | 183 | | |
184 | 184 | | |
| 185 | + | |
185 | 186 | | |
186 | 187 | | |
187 | 188 | | |
| |||
0 commit comments