A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/rwaldron/idiomatic.js/issues/13 below:

`switchObj` performance · Issue #13 · rwaldron/idiomatic.js · GitHub

I absolutely love the elegance and reusability of the switchObj pattern (even if it’s slower), but I’d like to get this straight.

See http://twatlr.com/thread/140407213511544833
Here’s @felixge’s test case: http://jsperf.com/object-vs-regular-switch

For my Velocity preso I created this test: http://jsperf.com/switch-vs-object-literal-vs-module/2 But it seemed regular switch was still faster. Any idea what’s up with that?

Rick’s test case only seems to test for the case where foo is a defined key in the switchObj, and doesn’t have the hasOwnProperty check. Perhaps that’s what caused the confusion?

/cc @rwldrn @jdalton @felixge


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4