Skip to content

Conversation

@zanxz-lol
Copy link

I made super small improvements to listIndex(), and listIndexSlow().

listIndex() no longer expects a string index first because numbers are more usually passed than 'last', or anything similar.
listIndexSlow() is more concise.

Also, checking with indexOf() first in listContains() is faster than only using compareEqual(). I was clearly on something last night..

@GarboMuffin
Copy link
Member

It helps if you can show at least some micro benchmark where these are faster

@zanxz-lol
Copy link
Author

listIndex() test done with no warp timer, tested 100,000 times each for 'any', 'last', and normal numbers:

numbers-old.txt
old average: 0.0001550000002483527 seconds

numbers-new.txt
new average: 0.00015333333303531012 seconds

Do you also want listContains() tests?

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.

2 participants