Test case name | Result |
---|---|
While Loop with cached parent_id | |
While Loop no caching parent_id | |
Using ForEach() instead of While Loop | |
While Loop without cache, using if/else instead of continue | |
While Loop without cache, using spread with assign | |
While Loop without cache, using spread only | |
For Loop version | |
Using ForEach() instead of While Loop, spread only | |
Using ForEach() instead of While Loop, spread only, no push() |
Test name | Executions per second |
---|---|
While Loop with cached parent_id | 49385.2 Ops/sec |
While Loop no caching parent_id | 40938.5 Ops/sec |
Using ForEach() instead of While Loop | 37674.7 Ops/sec |
While Loop without cache, using if/else instead of continue | 48730.6 Ops/sec |
While Loop without cache, using spread with assign | 28821.4 Ops/sec |
While Loop without cache, using spread only | 58936.9 Ops/sec |
For Loop version | 47289.8 Ops/sec |
Using ForEach() instead of While Loop, spread only | 53442.9 Ops/sec |
Using ForEach() instead of While Loop, spread only, no push() | 52848.4 Ops/sec |