Live data from Hacker News

Improving Angular performance with 1 line of code

medium.com

111–118 of 118 posts

Re: Improving Angular performance with 1 line of code

#111

Earlier quoted context omitted.

The tone of your comment sounds like you think I said one should never look at performance. I do this professionally, I should hope folks out there need performance. Let me be clear: A developer should place performance priority in the Right Place, and a good dev will know where that is. Would you mind linking a few of these studies? I'm curious as to what the point of diminishing returns is. nngroup [0] says that 10…

And what makes it OK to burn X% additional battery life across all your users devices? I take your general point but battery life is also a problem I have with React Native. Sure, you can drive animations from the JS thread and on modern devices in some cases you can't even tell the difference. But your battery can.

do you have any articles discussing react natives increased battery usage? why would it be any more than a native app?

Re: Improving Angular performance with 1 line of code

#112
post #98

Earlier quoted context omitted.

>>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 THIS! This is why battery life on mobile sucks everyone who thinks this way is the reason . As everything moves to the web, the performance of your code matters . So what if my phone has just enough CPU to render your site? You sh…

> Your job is supposed to be hard. you're an engineer! Please consider the consequences of your actions. My clients pay my wages and they are the ones who choose what my priorities should be. Where are these mythical developers who get to choose how long to spend on optimising working code without any financial imperatives? Outside of hobby projects there's always someone counting the pennies.

Only in this specific case it's exactly one line of code. Unless your hourly rate is obscenely high it is essentially a free optimization.

Re: Improving Angular performance with 1 line of code

#114
post #108

Earlier quoted context omitted.

It's a customer's decision, not a developer's one. A one liner like the one in the post should be added at zero cost by any developer, but more important optimizations compete with the budget of the features that sell the product of the customer. In my experience customers want features first, optimizations last and only if the unoptimized app/site runs too slow on their devices. And developers don't like to work for…

Even if the customer doesn't demand it, you should have your own standards for quality and performance and never compromise on them when it comes to your deliverables. You're actually harming your business if you choose to do shitty work for small bucks and good work for big bucks. If you take your standards very seriously it improves the capabilities of your team and let's you take on more lucrative contracts. > And…

I understand your feelings but I don't think they match the reality of many places around the world.

Maybe those developers earn so much that they can provide quality even if their customers don't explicitly demand it. But we can look at it in another way: their customer pay so much because they also pay for that quality and take it for granted. Deliver to them an unpolished product (in any way) and somebody else will code the next one.

Unfortunately not all customers are like that. Many of them fight for every single dollar/euro/whatever. They know they are compromising on quality and accept the tradeoff. After all, it's their privilege to decide the limits of their budget and maybe there is nothing they can do about it. The developer must accept it too, get the job done as quickly as possible and take another job. Or do very few and very long high quality jobs at unbearable costs and end up bankrupt quickly (and possibly piss off the customer because you're taking so long to deliver.)

Btw: customers give constraints also on time. There is no time to provide much quality when they want a feature delivered in a couple of days on a system you never saw before. It happened to me a few weeks ago. I made it but I could have done it better if I had at least one week? Sure. Would they pay me twice as much? Nope.

Re: Improving Angular performance with 1 line of code

#115
Great trick. Incredible that it's not on by default.

if you've applied that trick and still find yourself wondering what's taking up time, we just released a performance monitoring tool. We're looking for feedback, so please let me know how you find it: https://opbeat.com/angularjs

Re: Improving Angular performance with 1 line of code

#116
post #27

What the author discovered is really shitty defaults for Angular. Most software is like that. Don't blame the developers using the software, blame the Angular developers for choosing shitty defaults. Instead of choosing production ready defaults, they chose development ready defaults, creating more work for everyone.

>>Don't blame the developers using the software, blame the Angular developers for choosing shitty defaults. I like to blame developers who don't read the friggin documentation on the software they are using. This particular suggestion is literally the very first one in the developer guide for running Angular in production: https://docs.angularjs.org/guide/production

Oh please. There are thousands of Angular guides out there. Some people don't use the official documentation, especially when it's as shitty as Angular's is.

Re: Improving Angular performance with 1 line of code

#117

This is a case of bad defaults - why should a developer be required to write code, even if it is a one liner, to _disable_ debug? It should be the other way around - you write a single liner to enable debug.

Just another reason to hate angular.

Re: Improving Angular performance with 1 line of code

#118

This is a case of bad defaults - why should a developer be required to write code, even if it is a one liner, to _disable_ debug? It should be the other way around - you write a single liner to enable debug.

Just another reason to hate angular.

That's not just Angular. From the React README[1]:

> Note: by default, React will be in development mode. The development version includes extra warnings about common mistakes, whereas the production version includes extra performance optimizations and strips all error messages.

> To use React in production mode, set the environment variable NODE_ENV to production. A minifier that performs dead-code elimination such as UglifyJS is recommended to completely remove the extra code present in development mode.

[1]: https://www.npmjs.com/package/react

Post reply on HN