Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
jdd
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
11 ms
·
91.
▲
by
jdd
14y ago
@stephenhandley The readme has a link to a screencast that explains it a bit more.
92.
▲
by
jdd
15y ago
`Object('hi')` produces the equivalent of `new String('hi')`. The stringify behavior is spec'ed here http://es5.github.com/#x15.12.3 [Step 4b of the abstract operation Str(key, holder) algorithm]. See http://cl.ly/2E1l2X3X3U1B2N1d3G1k .
93.
▲
by
jdd
15y ago
@prodigal_erik @benatkin It is a JS polyfill/shim/fallback for older browsers like IE 6 and 7 but also fixes/fills in gaps in support/consistency with modern browsers that have buggy implementations. The use of the word "modern" in the desc
94.
▲
by
jdd
15y ago
Make sure you're not on a page with external scripts that could be mucking it up. If you're recent modern browser `JSON.stringify(Object('hi'))` should produce '"hi"'. See http://cl.ly/2J3B0e1z1o3e0T3x2b0l .
95.
▲
by
jdd
15y ago
@polemic @shantanubala `stringify` and `parse` are the names specified by the ECMAScript language spec: http://es5.github.com/#x15.12.3
96.
▲
by
jdd
15y ago
@spicyj I agree that recklessly paving natives is no good and can cause problems, but JSON3 is trying rather hard to not pave them (note that it doesn't even extend Date.prototype), and only paves parse/stringify when fixing broken implemen
97.
▲
by
jdd
15y ago
The audio from the SXSW panel discussion can be found here: http://lanyrd.com/2012/sxsw-interactive/spgqq/
98.
▲
by
jdd
15y ago
I doubt millions vs more-millions of ops/sec is ever going to be a real problem for anyone as engines are only getting faster. I've never heard someone say "Oh yeah, the bottleneck in our app was our use of `==`". The loops slides were more
99.
▲
by
jdd
15y ago
The test isn't broken in the scope of its use case. You are totally missing the point which is RegExp's are no longer a guaranteed fail when it comes to performance and that in many situations, including that jsPerf test, can out perform th
100.
▲
by
jdd
15y ago
Garbage collection was brought up during the Q/A and I would dig a jsPerf revision to explore that. One of the tests included in the slides was to see if simply using `eval` in a method would disable optimizations: http://jsperf.com/eval-k
101.
▲
by
jdd
15y ago
There is absolutely no need to use `void 0` you can simply use `typeof` or create a local `undefined` var. Many libs do this in their IIFE `(function(undefined) { /* your code */ }());`. The point was there isn't a real world performance co
102.
▲
by
jdd
15y ago
You're right that there isn't a real perf win as each are millions of ops/sec vs more-millions and not likely to matter in real world use.
103.
▲
by
jdd
15y ago
You shouldn't simply look at the pretty bar charts to draw conclusions. Results that are millions of ops/sec vs. more-millions ops/sec aren't likely to be a performance issue in real world use. Eval, with-statements, arguments.callee, the F
104.
▲
by
jdd
15y ago
The point of this test is to show that you should avoid making blanket assumptions about performance and that you shouldn't fear the RegExp :) You can see my full reply here: http://jsperf.com/regexp-indexof-perf#comment-3
105.
▲
by
jdd
15y ago
The point of this test is to show that by creating your own custom forEach-lite or other native-lite implementations you can get better performance over native. Many times you don't need to support all of the functionality/edge cases of the
106.
▲
by
jdd
15y ago
@jashkenas I think your example just happened to not have problems. Underscore.js still has problems ( https://github.com/documentcloud/underscore/issues/7 ) with Prototype.js. I have made a small test ( http://dl.dropbox.com/u/513327/under
107.
▲
by
jdd
16y ago
It's something like say your slow value was 25 ops/sec and your fast value was 100 ops/sec, then do (1 - 25 / 100) = 0.75. So as a percent 25 ops/sec is 75% slower than 100 ops/sec.
108.
▲
by
jdd
16y ago
There is, but it's not easily to digest at the moment. You need the Browserscope key + Google's visualization library. You can reference https://github.com/mathiasbynens/benchmark.js/blob/master/pl...
109.
▲
by
jdd
16y ago
Benchmark.js ( http://benchmarkjs.com ), which jsPerf uses, does checks the UA string as well as feature tests for various environments. You can check the code out at https://github.com/mathiasbynens/benchmark.js/blob/master/be... . Here i