Commit a65689e
authored
Slightly improve performance in engines/utils.py (#8747)
### Description
This change probably improves performance slightly (unforetunately, I
don't have a local instance of MONAI installed in order to test this,
but I'm pretty sure from looking at the code that using [], {} and
kwargs_[k] = _get_data(v) should be semantically the same and probably
slightly better in performance, see also #1423 (credits to @de-sh for
the nice fix 👍 ) where at least [] and {} were changed as a refactoring
and kwargs_[k] = _get_data(v) just seems better to me becuase I think
that this saves some time due to dictionary lookups and temporary
objects, but I'm not quite sure because it wasn't tested, so please
correct me if I'm mistaken).
A few sentences describing the changes proposed in this pull request.
### Types of changes
<!--- Put an `x` in all the boxes that apply, and remove the not
applicable items -->
- [x] Non-breaking change (fix or new feature that would not break
existing functionality).
- [ ] Breaking change (fix or new feature that would cause existing
functionality to change).
- [ ] New tests added to cover the changes.
- [ ] Integration tests passed locally by running `./runtests.sh -f -u
--net --coverage`.
- [ ] Quick tests passed locally by running `./runtests.sh --quick
--unittests --disttests`.
- [ ] In-line docstrings updated.
- [ ] Documentation updated, tested `make html` command in the `docs/`
folder.
---------
Signed-off-by: Benedikt Johannes <benedikt.johannes.hofer@gmail.com>1 parent 55c724f commit a65689e
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
219 | 219 | | |
220 | 220 | | |
221 | 221 | | |
222 | | - | |
223 | | - | |
| 222 | + | |
| 223 | + | |
224 | 224 | | |
225 | 225 | | |
226 | 226 | | |
| |||
0 commit comments