Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Migrate from forEach to for … of #391

Merged
merged 8 commits into from
Dec 1, 2023

Conversation

titouanmathis
Copy link
Contributor

@titouanmathis titouanmathis commented Nov 28, 2023

Some links that lead to this PR:

The latest link is a benchmark of both ways to loop over an array. It reveals that for … of loops are more performant on Firefox, Safari and Chrome.

@titouanmathis titouanmathis self-assigned this Nov 28, 2023
Copy link

github-actions bot commented Nov 28, 2023

Export Size

@studiometa/js-toolkit

Name Size Diff
usePointer 837 B +12 B (+1.45%) 🔺
objectToURLSearchParams 302 B +3 B (+1.00%) 🔺
addClass 219 B +2 B (+0.92%) 🔺
useDrag 1.65 kB +15 B (+0.92%) 🔺
importWhenVisible 465 B +4 B (+0.87%) 🔺
removeStyle 233 B +2 B (+0.87%) 🔺
useService 254 B +2 B (+0.79%) 🔺
useScroll 697 B +5 B (+0.72%) 🔺
withRelativePointer 987 B +6 B (+0.61%) 🔺
withBreakpointManager 1.05 kB +5 B (+0.48%) 🔺
useResize 640 B +2 B (+0.31%) 🔺
useLoad 373 B +1 B (+0.27%) 🔺
withBreakpointObserver 1.21 kB +3 B (+0.25%) 🔺
transition 924 B +2 B (+0.22%) 🔺
tween 1.22 kB +2 B (+0.16%) 🔺
animate 2.34 kB +3 B (+0.13%) 🔺
SERVICES 3.12 kB +1 B (+0.03%) 🔺
ALL 15.72 kB +4 B (+0.03%) 🔺
withResponsiveOptions 1.86 kB -1 B (-0.05%) 🔽
FRAMEWORK 11.66 kB -8 B (-0.07%) 🔽
HELPERS 1.17 kB -1 B (-0.09%) 🔽
DECORATORS 6.48 kB -6 B (-0.09%) 🔽
useRaf 726 B -1 B (-0.14%) 🔽
withScrolledInView 1.93 kB -3 B (-0.16%) 🔽
Base 7.18 kB -18 B (-0.25%) 🔽
useKey 630 B -2 B (-0.32%) 🔽
UTILS 5.85 kB -19 B (-0.32%) 🔽
historyReplace 466 B -3 B (-0.64%) 🔽
addStyle 232 B -2 B (-0.85%) 🔽
importOnInteraction 440 B -4 B (-0.90%) 🔽
toggleClass 220 B -3 B (-1.35%) 🔽
removeClass 217 B -3 B (-1.36%) 🔽
historyPush 461 B -7 B (-1.50%) 🔽
domScheduler 296 B -6 B (-1.99%) 🔽
createApp 292 B -6 B (-2.01%) 🔽
useScheduler 290 B -25 B (-7.94%) 🔽
Unchanged

@studiometa/js-toolkit

Name Size Diff
boundingRectToCircle 154 B -
clamp 67 B -
clamp01 87 B -
collideCircleCircle 99 B -
collideCircleRect 159 B -
collidePointCircle 112 B -
collidePointRect 103 B -
collideRectRect 99 B -
createEaseInOut 116 B -
createEaseOut 71 B -
damp 78 B -
debounce 92 B -
ease 410 B -
easeInCirc 68 B -
easeInCubic 59 B -
easeInExpo 80 B -
easeInOutCirc 141 B -
easeInOutCubic 130 B -
easeInOutExpo 134 B -
easeInOutQuad 128 B -
easeInOutQuart 133 B -
easeInOutQuint 152 B -
easeInOutSine 151 B -
easeInQuad 63 B -
easeInQuart 61 B -
easeInQuint 62 B -
easeInSine 77 B -
easeOutCirc 115 B -
easeOutCubic 103 B -
easeOutExpo 112 B -
easeOutQuad 103 B -
easeOutQuart 100 B -
easeOutQuint 103 B -
easeOutSine 121 B -
focusTrap 496 B -
getAncestorWhere 91 B -
getAncestorWhereUntil 119 B -
getClosestParent 178 B -
getComponentResolver 138 B -
getDirectChildren 183 B -
getInstanceFromElement 90 B -
getOffsetSizes 160 B -
hasWindow 62 B -
importOnMediaQuery 236 B -
importWhenIdle 223 B -
importWhenPrefersMotion 275 B -
inertiaFinalValue 142 B -
isArray 70 B -
isBoolean 78 B -
isDefined 86 B -
isDev 72 B -
isDirectChild 212 B -
isFunction 72 B -
isNumber 84 B -
isObject 105 B -
isString 86 B -
keyCodes 100 B -
lerp 57 B -
map 71 B -
matrix 106 B -
memoize 189 B -
nextFrame 175 B -
nextMicrotask 111 B -
nextTick 134 B -
noop 39 B -
noopValue 49 B -
Queue 226 B -
round 56 B -
scrollTo 417 B -
SmartQueue 411 B -
throttle 101 B -
transform 317 B -
wait 79 B -
withDrag 1.79 kB -
withExtraConfig 135 B -
withFreezedOptions 140 B -
withIntersectionObserver 279 B -
withLeadingCharacters 88 B -
withLeadingSlash 107 B -
withMountOnMediaQuery 338 B -
withMountWhenInView 313 B -
withMountWhenPrefersMotion 390 B -
withoutLeadingCharacters 86 B -
withoutLeadingCharactersRecursive 124 B -
withoutLeadingSlash 93 B -
withoutTrailingCharacters 98 B -
withoutTrailingCharactersRecursive 129 B -
withoutTrailingSlash 103 B -
withTrailingCharacters 96 B -
withTrailingSlash 120 B -
withVue2 369 B -

Copy link

codecov bot commented Nov 29, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (574ffa8) 97.63% compared to head (8178064) 97.62%.
Report is 2 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #391      +/-   ##
===========================================
- Coverage    97.63%   97.62%   -0.01%     
===========================================
  Files           97       97              
  Lines         2239     2230       -9     
  Branches       535      538       +3     
===========================================
- Hits          2186     2177       -9     
  Misses          52       52              
  Partials         1        1              
Flag Coverage Δ
unittests 97.62% <100.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@titouanmathis titouanmathis merged commit a12076e into develop Dec 1, 2023
@titouanmathis titouanmathis deleted the feature/migrate-to-for-of branch December 1, 2023 08:30
@titouanmathis titouanmathis mentioned this pull request Dec 1, 2023
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