Live data from Hacker News

Improving Angular performance with 1 line of code

medium.com

31–40 of 118 posts

Re: Improving Angular performance with 1 line of code

#31
I've played with this setting on a few projects and didn't notice any big difference so I'd like to see benchmarks for it. I reasoned that if it's not significantly slowing the code down and could be used for easier debugging later I didn't see the harm leaving it in.

Re: Improving Angular performance with 1 line of code

#32

As someone who's specialized in AngularJS optimization [0], this doesn't surprise me in the least. Developers leave plenty of performance optimizations on the table, some worse than this one. The truth of the matter is that in the general case, it doesn't matter. We engineers like to go on and on about this or that perf efficiency but most of the time the code runs fast enough (and the majority of the time when it do…

Some deoptimizations are ahead-of-time planted to make performances increases easy to enable in the future.

http://thedailywtf.com/articles/The-Speedup-Loop

Re: Improving Angular performance with 1 line of code

#37
post #29

I've searched a few minutes for any blog post or article which demonstrates the performance difference between turning this setting on or off, and I haven't found anything. If you don't have a benchmark, you don't have a performance boost.

This is a silly statement. Not everything is placebo. I'm working on a bigger Angular application and adding this one line of code made a small perceivable difference.

Did you do a double blind test or use any instrumentation to confirm your perception? I ask as someone who has more than once been convinced that I'd made something faster only to prove myself wrong after measuring it.

Re: Improving Angular performance with 1 line of code

#38

Wow, I did not know that everyone else also right clicked to "inspect element" all over the place, for no reason... I love moments like this.

It comes in quite handy when you're dealing with sites that attempt to hide content behind a paywall, with just a front-end solution...

#nevertrusttheclient

Re: Improving Angular performance with 1 line of code

#40

As someone who's specialized in AngularJS optimization [0], this doesn't surprise me in the least. Developers leave plenty of performance optimizations on the table, some worse than this one. The truth of the matter is that in the general case, it doesn't matter. We engineers like to go on and on about this or that perf efficiency but most of the time the code runs fast enough (and the majority of the time when it do…

Tried this out on a work project a month or two ago, found it worked quite well and had a noticeable performance boost.

Unfortunately a bunch of inherited legacy code uses angular.element().scope() in a lot of places which then breaks without this turned on, so I had to revert it.

Post reply on HN