cylc-flow icon indicating copy to clipboard operation
cylc-flow copied to clipboard

Speedup.replace uniq with list of iter uniq

Open wxtim opened this issue 10 months ago • 0 comments

list(iter_uniq(iterable))
# Is an order of magnitude faster than
uniq(iterable)

In both Python 3.8 and 3.13.

Full experiment posted in notebook in this comment.

[!NOTE] This will conflict with #6574 and will need to either be merged first or rebased.

Check List

  • [x] I have read CONTRIBUTING.md and added my name as a Code Contributor.
  • [x] Contains logically grouped changes (else tidy your branch by rebase).
  • [x] Does not contain off-topic changes (use other PRs for other changes).
  • [x] Applied any dependency changes to both setup.cfg (and conda-environment.yml if present).
  • [x] This is a change of method, not interface:
    • Existing tests cover change.
    • Changelog not req'd
    • Opened against master
    • Docs not req'd

wxtim avatar Mar 12 '25 09:03 wxtim