You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was doing some test and i find-out that Reactor arrays new Reactor([]) are really slow when using the sort method myReactor.sort on big Reactor arrays. For an array of 1000 items it take me ~ 30ms and for 5000 items it take me ~6800ms and this his exponential.
The same problem happened with Array.forEach and Array.map but duration is linear.
A workaround is to use shuck, Array.splice and Array.length like that :
constreactorArray=newReactor([])constnewArray=shuck(reactorArray).sort();reactorArray.length=0;// without this line, the problem stay the samereactorArray.splice(0,0, ...newArray);
Hi,
First thank you for this library !
I was doing some test and i find-out that Reactor arrays
new Reactor([])
are really slow when using the sort methodmyReactor.sort
on big Reactor arrays. For an array of 1000 items it take me ~ 30ms and for 5000 items it take me ~6800ms and this his exponential.The same problem happened with
Array.forEach
andArray.map
but duration is linear.A workaround is to use
shuck
,Array.splice
andArray.length
like that :i have done a CodePen (https://codepen.io/sliverside/pen/yLZoJWJ) where you can see/modify/adapt my tests.
Thanks for your time !
The text was updated successfully, but these errors were encountered: