Comment

Comment by natefaubion

Take a look at the next sentence: "Keep in mind, that time is measured in the single microseconds (1µs vs 3µs) to dispatch 5 calls to the same function."

So you are still looking at sub-microsecond dispatch time for a single call. If you look at benchmark/compare.js you'll see how much shorter and clearer the pattern matched function is. I doubt this will put a strain on your performance.

edit: That said, there is likely room for optimizations and speed improvement. It will naturally take longer because it has the overhead of making function calls to the various pattern functions to check if there's a match, instead of having it all inlined like in the hand optimized function.

edit2: Sorry, this was in response to another comment that looks like it got deleted while I was editing. Now its attached itself elsewhere.

parent natefaubion 14 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton