Live data from Hacker News

Improving Angular performance with 1 line of code

medium.com

1–10 of 118 posts

Re: Improving Angular performance with 1 line of code

#8
post #5

I'd like to see some data indicating there is actually an appreciable performance difference. Indeed, with only one line of code to add, the setup cost is low, but this article asserts a performance gain without any evidence.

The official Angular docs describe it thusly:

    You may want to disable this in production
    for a significant performance boost
https://docs.angularjs.org/api/ng/provider/$compileProvider

I'm inclined to believe the engineers who wrote the docs on this.

Re: Improving Angular performance with 1 line of code

#9
post #2

Shouldn't debugging be something you opt-in to rather than opt-out of? Seems like a weird design choice

I'd be interested in how significant the actual performance hit is - I see no measurements.

There are plenty of times you'd want to enable various debug features, even in production, even if it means leaving them always on. The only real question is if the tradeoffs are worth it - the performance hit, if any, and the security implications, if any, versus the productivity gains.

Re: Improving Angular performance with 1 line of code

#10
post #5

I'd like to see some data indicating there is actually an appreciable performance difference. Indeed, with only one line of code to add, the setup cost is low, but this article asserts a performance gain without any evidence.

The official Angular docs describe it thusly: You may want to disable this in production for a significant performance boost https://docs.angularjs.org/api/ng/provider/$compileProvider I'm inclined to believe the engineers who wrote the docs on this.

A Twitter engineer mentioned this in a lightning talk in the AngularJS SF meetup a little more than a year ago - he mentioned that he found speed gains of about 33% with that one line.

It's a great tool to have in your belt for optimizing angular apps, most people working with angular are not aware of this unfortunately.

Post reply on HN