Skip to content

perf: use iterative loops in waitForCondition, asyncmap, and asyncfilter - #91

Open
hoanle0126 wants to merge 1 commit into
appium:masterfrom
hoanle0126:perf/iterative-wait-and-serial-loops
Open

hoanle0126 wants to merge 1 commit into
appium:masterfrom
hoanle0126:perf/iterative-wait-and-serial-loops

Conversation

@hoanle0126

Copy link
Copy Markdown
  • Replaces the recursive return await spin() call in waitForCondition with a while (true) loop so long-running polling loops do not accumulate nested promise frames.
  • Replaces coll.reduce in asyncmap and asyncfilter when options === false with sequential for...of loops, avoiding O(n^2) array spread allocations ([...(await acc), ...]) in asyncmap and upfront promise chain creation across the entire collection.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant