DEV Community

Discussion on: Javascript Algorithms #1: Counting the Vowels in a String Of Text

Collapse
 
dallgoot profile image
dallgoot

i'm sorry : i've tried to run an alternate version of the first function and ended spamming tests :/
I'm also performance obsessed ;)

Collapse
 
worldclassdev profile image
Philip Obosi

Awesome Dallgoot. What's the issue with the tests?

Collapse
 
dallgoot profile image
dallgoot

No issues with the tests but many with the guy (me) who tried to make changes in them ;)
i wanted to try a version with a switch replacing the array check to see perf differences but failed miserably for some reason...

Collapse
 
dallgoot profile image
dallgoot

finally: I got some tests working (Revision 7, you can delete others)
So I'm seeing what I expected: switch cases are faster than array searching.
Not from much though, but still with so few values.

Thread Thread
 
worldclassdev profile image
Philip Obosi

Nice one man. Seen it.