Skip to content
Advertisement

Tag: performance

Why is mutating the [[prototype]] of an object bad for performance?

From the MDN docs for the standard setPrototypeOf function as well as the non-standard __proto__ property: Mutating the [[Prototype]] of an object, no matter how this is accomplished, is strongly discouraged, because it is very slow and unavoidably slows down subsequent execution in modern JavaScript implementations. Using Function.prototype to add properties is the way to add member functions to javascript

NodeJS: Would App Run Faster if Freeze Objects?

Most of my objects/functions do not change. Would the application run faster if I freeze most of the objects via Object.freeze(object)? Or will it make no difference at all? Answer Freezing (and sealing) causes a signficant performance hit instead of a gain across various browsers. Just take a look at some of the jsperf benchmarks. EDIT: Here’s the relevant issue

Jquery form submission not being triggered

I’m new to JavaScript. I have been trying to design some code which geocodes a location when a search button is hit and the submits the form if successful. To make it to slightly more complicated, if an option from the autosuggest is selected, it also geocodes it even before the search button is hit. This all seems to work,

Who is faster: PEG or GLR?

I’m trying to create some kind of lint tool for the C/AL programming language. So basically I need to perform syntax and lexical analysis against the source code. I’ve planned to write parser from the scratch, but then discovered that there are a lots of tools helping generate these parsers automatically. I need performance, since checking 20 megabytes of code

Should CSS always precede JavaScript?

In countless places online I have seen the recommendation to include CSS prior to JavaScript. The reasoning is generally, of this form: When it comes to ordering your CSS and JavaScript, you want your CSS to come first. The reason is that the rendering thread has all the style information it needs to render the page. If the JavaScript includes

Track mouse speed with JS

What’s the best way to track the mouse speed with plain JS/JQuery? I’d like to track how fast a user moves the mouse in all directions (up/down/left/right). Answer Sparklines has a nifty example of tracking mouse movement and graphing it. Their code is available in the source of their site starting at line 315. Simple and effective. Here is the

Advertisement