Re: Which is faster ?

new topic     » goto parent     » topic index » view thread      » older message » newer message
mattlewis said...
DerekParnell said...

Just a bit more clarification, find() is faster for long sequences. If the sequence is, say less than 10-15 items, then a loop can be faster.

Do you have any benchmarks that demonstrate this?

No. Actually I mis-remembered. What I was thinking about was the difference between find() and map() - there is a point at which map() becomes faster than find(). But you are correct, find() is always faster than looping if you have an unordered sequence to scan through.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu