Use list for file_dep (fixes #254).#430
Conversation
|
Thanks. If my memory is correct I made it a set() instead of list for performance reasons. Please also add an entry on CHANGES, and doc changes (not sure if relevant or where). |
|
I've had a look running the tests on Test duration resultsExecuting all tests$ (master) repeat 5 time pytest > /dev/null
pytest -q > /dev/null 2.88s user 0.84s system 52% cpu 7.054 total
pytest -q > /dev/null 2.80s user 0.82s system 52% cpu 6.949 total
pytest -q > /dev/null 2.79s user 0.82s system 52% cpu 6.905 total
pytest -q > /dev/null 2.79s user 0.80s system 52% cpu 6.872 total
pytest -q > /dev/null 2.85s user 0.83s system 51% cpu 7.089 total$ (file_dep-list) repeat 5 time pytest > /dev/null
pytest -q > /dev/null 2.80s user 0.82s system 52% cpu 6.925 total
pytest -q > /dev/null 2.77s user 0.80s system 52% cpu 6.855 total
pytest -q > /dev/null 2.76s user 0.80s system 51% cpu 6.853 total
pytest -q > /dev/null 2.79s user 0.81s system 52% cpu 6.898 total
pytest -q > /dev/null 2.77s user 0.80s system 52% cpu 6.857 totalExecuting only tests in
|
2666f9c to
778f448
Compare
|
I've had another look at performance, and I think this change would not negatively affect performance. I use # setup.py
import os
os.makedirs("inputs", exist_ok=True)
for i in range(5000):
with open(f"inputs/{i}.txt", "w") as fp:
fp.write(str(i) * i)# dodo.py
import os
os.makedirs("inputs", exist_ok=True)
for i in range(5000):
with open(f"inputs/{i}.txt", "w") as fp:
fp.write(str(i) * i)Here's the evaluation. # git:file_dep-list
$ time (repeat 100 doit)
...
8.15s user 3.18s system 94% cpu 11.962 total
# git:master
$ time (repeat 100 doit)
...
8.19s user 3.19s system 94% cpu 12.044 total |
|
Hi @schettino72, just wanted to follow up whether this is something you're interested in merging. |
|
@tillahoffmann sorry for delay. I am planning to dedicate some time for open-source in the last week of this month. |
This PR fixes #254 by changing
file_depto a list rather than using a set, ensuring the order of dependencies is preserved.