News for hackers. Stuff that matters.
Re:These are called opportunities by polote on Thursday December 03, 2020 @03:28AM (#25286817)
in my previous job, as a PM, I was creating tickets all the time to work on the speed of the app, but the developers didn't not want to work on them, they were saying the users don't care.

The reality is that they didn't know how to fix the speed issues.

It is easy to debug a js function, but what about when you use angular or any other js framework ?

Re:These are called opportunities by mattmanser on Thursday December 03, 2020 @06:00AM (#25287706)
So I've done this a few times and constantly play with the idea of offering it as a consultancy service.

Two things put me off, I do wonder if anyone else here has attempted to do it as a consultant?

Firstly, while I could quickly identify the cause of the slowdowns, the previous times I've done this I already had an intimate knowledge of the codebase so could confidently fix the problem. Without an intimate knowledge of the codebase, I fear I'd either muck up the fix, or that I'd have to rely on internal developers who, as you say, would deprioritize it or feel resentful at an outsider coming in and from their perspective effectively telling them their code is "bad" (even though I understand how these speed issues develop organically). Or would it be enough to just offer the diagnosis, but not the fix, and thus give ammo to the PMs/senior management to take the problem to their own developers and say "look, we've been told there's a problem and it's fixable, go fix it".

Secondly, how to handle getting access to their codebase/a proper debug environment that reflects production for such a short time. Again I fear it would turn into a "not my problem" scenario of trying to get a live environment setup from people who don't want to give it to you. Fixing these problems usually turns out to be fairly quick once you've identified the real cause. I can do a quick analysis just with access to a website (i.e. is it a back-end or front-end problem), but until you can run diagnostics you can't say exactly which loop/sql statement/js compilation issue/etc. is causing the problem.

Re:These are called opportunities by calpaterson on Thursday December 03, 2020 @08:45AM (#25288737)
I take contract work and I try hard to check in some speedups in every project I touch. It's not hard to find issues. Just profile, most people never do. The other trick of finding problem code is to talk to the sysadmins - they tend to know and often are not shy about criticising those awful lazy devs :)

I don't think you can offer it as a consultancy service because people tend not to care and are quite aggressive about that. They would much prefer to pay for more hardware and doing so is organisationally respectable: "the cloud will solve our problems".

Re:These are called opportunities by mattmanser on Thursday December 03, 2020 @01:37PM (#25292664)
A few of my clients asked for it and kept raving on about the improvements long after it was done. Which is one of the reasons I considered it.

I think programmers might not care, I'm not sure their managers and PMs don't.

Re:These are called opportunities by bsenftner on Thursday December 03, 2020 @08:33AM (#25288630)
My solution to this issue to to hire only former C/C++ video game developers for non-video game software development. Their attention to performance is innate, their attention to critical obscure details is innate, and their desire to write code they are proud is innate. Plus they come with advanced, useful math knowledge. I love former game developers because they did the pop culture dev job, saw it was exploitation, and took their incredibly optimized skills elsewhere.
Re:These are called opportunities by wolco2 on Thursday December 03, 2020 @10:09AM (#25289522)
We do this a lot. We take a truth + mix it in with our personal situation and broadcast this information as truth and someone comes around and follows this and finds it to be untrue.

Hiring ex C/C++ game developers is fine on the surface. They are smart people and can pick up things quickly.

But as a general rule it fails.

Taking longer to get things perfect is usually not a tradeoff in the webworld that makes sense. People want simple, reuseble and quickly changable features. Pixel perfect perhaps but never code perfect because things change quickly. Why would you hire for that?

Higher salaries for no reason.

Learning curve will be harder than one expects

Smaller pool.

Greater unhappiness. You might hear after writing a game engine that web work is 90% easier but so boring.

Hire an ex c/c++ developer because they show an interest in making a change and are willing to put in the work. Don't hire all of them and expect an advantage..

Re:These are called opportunities by bsenftner on Thursday December 03, 2020 @04:21PM (#25295168)
Who says programmers are responsible for pixel perfection? That's what the graphic artist do. But I get your point of thinking former game developers would be too exacting. That is what hiring filters and management is for, so you hire with reason and guide them to the company's level of production quality.

Also, the typical game is significantly larger than any single gamer experiences, and game developers certainly know the tradeoff of "good enough". Plus game production environment is a technological feat in itself too, and it is those type of game developers that contain the most value - not necessarily the game play developers, but the game production pipeline developers.

Re:These are called opportunities by mattmanser on Thursday December 03, 2020 @09:10AM (#25288934)
It's good it works for you, but in terms of webapp development, wouldn't they have very little skill at databases? And focus on optimizations that are completely irrelevant for 99% of webapps?

I've seen before code where premature, pointless or unclear optimizations used, like dogmatically using stringbuilders or avoiding boxing saving all of a couple of nano-seconds, while the SQL statement is taking 3 seconds to run due to unnecessary sub-selects because the developer doesn't grok set-based logic. Or worse, cursors because they think they need a loop!

Re:These are called opportunities by bsenftner on Thursday December 03, 2020 @09:34AM (#25289178)
Many game devs have their own fairly advanced web sites, and they professionally know about pre-optimization issues. Also game production environments have been using databases for decades, the game production environments certainly have optimized database operations, and their developers are experienced with this too because building an internationalized multi-language game is far more complex than the game itself.
Re:These are called opportunities by mattmanser on Thursday December 03, 2020 @01:56PM (#25292915)
I think we're from different worlds, from your profile it's seems you don't work on e-commerce and sass, which is what I'm referring to. Though admittedly I didn't open with that!

Just like I can't imagine the true depth of complexity of game/3d development having dabbled making games in unity, I'm not sure you understand just how complex a sass/enterprise site can get, it's usually issues with actually organising the code that gets you, rather than the code itself.

Your example of i18n is actually quite telling, having internationalized a couple of sites that's actually a fairly simple organizational problem in our codebases, comparatively not really complex at all, just tedious.

Re:These are called opportunities by bsenftner on Thursday December 03, 2020 @04:09PM (#25294967)
I authored a moderately large (scaled for global use) e-commerce / webapp / webAPI, as well as operated as a tech architect + MBA for a number of web startups. I have a pretty good idea of the complexity, architecture variations, and bottlenecks.

My example intended to reference more than i18n, as that only covers the interface. Consider something like an online international university where there is media, but that media varies with 8 different languages, so each and every aspect of any presentation needs to accommodate variable length text fields, left and right and vertical directions of text display, every media clip varies in length due to language, and multi-language users can switch display mode at will. I've done projects like this, over a dozen, and it's quite the challenge.

Re:These are called opportunities by mattmanser on Thursday December 03, 2020 @06:50PM (#25297135)
I've never heard a positive thought about anyone who describes themselves as an "architect" in the industry.
Re:These are called opportunities by bsenftner on Friday December 04, 2020 @09:54AM (#25302850)
When hired by a "tech" startup with no technologists in their team, I call myself an architect to separate myself so they don't think I am going to be writing their code directly. Typically, such "startups" only last a quarter, because they have no experience working in tech, but I can guide them so they don't die in a quarter by providing them with a "how to be a technology developer blueprint" that tends to be received like the holy grail.
Re:These are called opportunities by jlokier on Thursday December 03, 2020 @03:49AM (#25286952)
I find that quite fascinating. I love making things perform faster. It's one of the most rewarding things to do as a programmer, and "low hanging fruit" optimisations are usually quite simple, "mindless" work, to do in a quiet period between solving hard problems. The wins are easily measured. It can take a long time to do in a complex system, but it's usually pleasant and relaxing time.
Re:These are called opportunities by Elte on Thursday December 03, 2020 @03:52AM (#25286969)
Yeah same here! Nothing like watching a 200ms timer go down to 100ms just because you swapped out some data structure or cached some variable. It's a very satisfying game to me.
Re:These are called opportunities by essayist on Thursday December 03, 2020 @12:21PM (#25291479)
I'm old enough to have been a timesharing programmer (when a 32k->64k working memory increase seemed like limitless abundance).

The company I worked for offered very expensive timesharing by the hour. Clients used an "Englishy" interpreted language to do economic forecasts, and client staff often programmed their own procedures.

My boss came to me one day to request that I speed up something a client had developed themselves, because it had become too expensive for them to run, and they were ready to bolt.

I had no desire to understand what their code did, and so treated the code mostly like a blackbox, and my job as speeding things up while leaving the transformation of inputs to particular outputs intact.

I had enough experience to know what the low hanging fruit were and went after those in the code. A day's work or so, and we got a 50-90% speed-up, enough to satisfy the client. I still don't really know what the code did. But I enjoyed the effort.

Re:These are called opportunities by dawidw on Thursday December 03, 2020 @05:03AM (#25287419)
Indeed. It is such a pleasure to work on purely technical challenge - no BAs, no meetings, no customers - just you and the code.
Re:These are called opportunities by kranner on Thursday December 03, 2020 @05:28AM (#25287555)
Same here. The two most interesting parts of programming to me are optimisation (mostly speed, sometimes memory though it's not needed as often) and debugging (especially when I can just reason out where the bug must be and it turns out to be correct).
Re:These are called opportunities by bsenftner on Thursday December 03, 2020 @08:36AM (#25288654)
I just had the pleasure of optimizing a video subsystem startup from 44 seconds to just under 2 seconds. I expect to get down to 200 ms by end of day. I love optimization.
Re:These are called opportunities by tjansen on Thursday December 03, 2020 @04:51AM (#25287349)
I also love to optimize code, but I know many developers who wouldn't even know where to start.
Re:These are called opportunities by sumtechguy on Thursday December 03, 2020 @09:02AM (#25288871)
I always start with timing it. The thing is many projects I end up in it feels like a death by a thousand cuts. Every sub function is very quick but overall together they take up tons of time. I worked one project where I took logins from 6 seconds to sub 100ms. No one cared or even noticed. Even though it was top 10 on every metric we had.
Re:These are called opportunities by _ph_ on Thursday December 03, 2020 @05:02AM (#25287415)
Provocatively asked: who was right?

This sounds more like an organizational problem. The project leader has to decide whether speed issues need fixing or not. If they don't need fixing, then it is indeed a wasted resources trying to do so. If they need fixing, then of course it is the task for the project leader to find the neccessary resources.

Speed issues are almost never unfixable. But, the cost of doing so might be prohibitive, usually companies deliver products which are just fast enough. The question is, with a given budget, how do you ship the better product for the customers needs? Do you want it to be fast with fewer features or not quite as fast, but having many more required features? To decide this, it is the job of the project lead, the architects and of course marketing, which has to sell the product.

And both as a project lead and a developer, I can say, it is really fun to make something faster and more efficient, but far too often there isn't the time/resources for it. Most of the time you have a customer waiting for new functionality or bug fixes much more urgently than for some speed improvements.

Re:These are called opportunities by CaptArmchair on Thursday December 03, 2020 @05:43AM (#25287629)
This comes down to defining and generating "value".

Speed, features and bug fixes are all different forms of value. But value isn't an absolute. It's always in the eye of the beholder and depending on where a stakeholder is coming from, they are prioritized differently.

From a business perspective, balancing between different types of values is paramount. The end goal, after all, is to always deliver value that generates revenue exceeding expenses at an acceptable level.

This is why legacy software is a thing. The business assesses that an old tool still generates value for paying customers and revenue while spending an acceptable amount of time on maintenance. In the context of a large system with a large userbase, this may imply dedicating one or two developers full time towards keeping the lights on.

Many software projects don't get a rewrite. Why? Because over the course of years, business and technological contexts for all stakeholders - both the business and the customers - change so much that they become irrelevant. For instance, the business pivoting away towards a new lucrative market or product, or customers moving away to a competitor offering the same value but at a better price point and with up-to-date technology. Just consider many services and products you've used over the years and how many of them have been shelved or sunset without ever being rewritten.

While the necessity of a full rewrite may pop up over technical concerns such as security or performance. It's only when business and functional requirements have shifted away to a serious degree from the original scope of the project that organizations tend to consider dedicating time and resources to a successor. At that time, a rewrite isn't necessarily the only option: sourcing a product that does the same thing but better from an outside supplier could be a valid option as well. For instance, chucking away your own homegrown decade old CRM for Salesforce as your business grew from a 5 person outfit to a 120 person business servicing enterprise.

Re:These are called opportunities by bryanrasmussen on Thursday December 03, 2020 @05:50AM (#25287657)
>in my previous job, as a PM, I was creating tickets all the time to work on the speed of the app, but the developers didn't not want to work on them

In my experience it is always the PM or product owner telling me not to work on improving speed. How slow was the app, I guess the devs would be right if it was like 2 seconds or less to load/render, at that point working on speed has diminishing returns.

Re:These are called opportunities by nicoburns on Thursday December 03, 2020 @07:39AM (#25288262)
It's actually easy in JS frameworks too (at least React, not sure about Angular which is just generally more difficult to work with). In fact, they make it much easier to write performant UI code (that's half the benefit).

You generally don't need to debug the framework. Just follow some simple best practices and the performance will just happen in 99% of cases.

Re:These are called opportunities by sangnoir on Thursday December 03, 2020 @02:49PM (#25293726)
> It is easy to debug a js function, but what about when you use angular or any other js framework ?

As someone who worked on a successful web-application perf-improvement project in a past life, my top 3 tricks were: 1. Profile, and use flame-graphs & call-graphs (with counts) to identify which parts are slow 2. Don't do unnecessary work 3. Execute code asynchronously whenever possible (requires balancing with code readability)

Not doing unnecessary work may be straight forward, and sometimes very complicated. Simple: some results are discarded, or some expensive functions are called for a minor side-effect just because developers were told to "maximize code reuse" at all costs. Complicated: understanding which function calls that unexpectedly block/delay browser rendering/painting

Re:These are called opportunities by megablast on Thursday December 03, 2020 @03:31AM (#25286826)
Or they are unfixable. And explaining why to a non technical pm can take all day.
Re:These are called opportunities by Cthulhu_ on Thursday December 03, 2020 @03:41AM (#25286888)
At some point you will end up with a maximum, a "best I can do with this code", but it's often a constraint because of the underlying architecture; you can't make Angular any faster, but you can consider shifting to a different framework. You can't make webapps any more memory efficient, but you can consider building a native app. You can't make processing a TB of data on a single computer faster, but you can consider making it a distributed, horizontally scaled task.
Re:These are called opportunities by MattGaiser on Thursday December 03, 2020 @05:50AM (#25287661)
Do you want to give a non-technical that option? As they could easily just hear the "here is how to fix it", ask for it, and then be left wondering a week later when the project is back at square one.
Re:These are called opportunities by Tepix on Thursday December 03, 2020 @04:33AM (#25287210)
We are very far away from "unfixable" performance issues pretty much everywhere, except perhaps in the demo scene with hand written assembly code and in some shader code running on GPUs.
Re:These are called opportunities by tjansen on Thursday December 03, 2020 @04:49AM (#25287341)
In theory you're right. In real life, it's unlikely that the developers who were (probably barely) able to implement the system in a high-level language are able to rewrite and it in assembly code. And even if they were, unless you don't intend to change the code ever again, it's more likely you're just piling up technical debt.
Re:These are called opportunities by _ph_ on Thursday December 03, 2020 @05:05AM (#25287436)
Assembly isn't a good example, there are plenty of high level languages which produce excellent compiled output. But you have to use those, not any fancy new language or framework.

But your point is correct in that in many projects there isn't enough budget to make the product faster. Which is a project management decisions, not that the speed issues are unfixable.

Re:These are called opportunities by ori_b on Thursday December 03, 2020 @09:20AM (#25289032)
Are you seriously suggesting that there's no improvement to be had in the typical ui without rewriting in assembly?
Re:These are called opportunities by polote on Thursday December 03, 2020 @03:32AM (#25286835)
that was not the case, I ended being the one plotting the flame charts as no-one wanted to do it
Re:These are called opportunities by Aeolos on Thursday December 03, 2020 @03:59AM (#25287009)
Similar experience as a PM and as a technical director: the vast majority of devs, outside maybe 3d rendering or HPC, do not understand nor care about performance optimization.

Implementing some feature, fixing a bug, refactoring code to improve DX? Sure, happy to do, you don’t even have to ask. Plotting tail response times, flame charts, allocation pressure, DOM changesets, database execution plans? No chance, unless the PM forces the matter.

My hope is that some of that can be taught and embedded into the team culture, but the reality is that day-to-day web development is simply too far abstracted from the underlying software and hardware, and getting your average javascript programmer to care about milliseconds is an uphill battle.

The sad thing is that users do definitely care, and the evidence shows up again and again: user behaviour tests for 100ms vs 500ms responses, the reviews of the new M1 processors, ...

Re:These are called opportunities by TeMPOraL on Thursday December 03, 2020 @04:35AM (#25287231)
> Plotting tail response times, flame charts, allocation pressure, DOM changesets, database execution plans?

Is anybody even teaching people these things? I do the above as a matter of course, but I've learned how and why through osmosis, over the years, mostly because I dabble with gamedev as a hobby (and because I care about performance). None of that was covered in any of my university courses. And, out of the people I worked with, I was and am literally the only one who knows how to do any of that.

Re:These are called opportunities by Aeolos on Thursday December 03, 2020 @06:08AM (#25287746)
You hit a vein of truth here, I don't recall any of that being covered in a university course or in any of the companies I've worked with. My knowledge too comes from dabbling with gamedev, programming/hacking underpowered hardware (90's consoles), and spending (too much) time on open-source projects where performance optimization mattered.

I don't expect my colleagues to have the same kind of experience, but I would expect someone presenting as a "senior frontend engineer" to understand the GC impact of allocating thousands of objects in a tight computation loop; or of doing heavy computations / updating the DOM inside a mouse move event handler.

On the other hand, Slack is worth $27.7B and is still selling a product that has frustrating multi-second delays on standard keyboard interactions, so I don't know. Maybe I am really just expecting too much.

Re:These are called opportunities by yellowapple on Thursday December 03, 2020 @04:45AM (#25287298)
That raises an important question, though: is it really true that the developers don't care? Or is it more a matter of these performance improvements falling to the wayside because management pushes features and/or bugfixes first?

I've definitely seen both in the wild, so it's an important question to ask every time, rather than sticking to a blanket assumption of "devs neither understand nor care about performance optimization".

Re:These are called opportunities by Aeolos on Thursday December 03, 2020 @06:20AM (#25287815)
That can definitely be the case. In our case, we sometimes have MR's that specifically mention things like "I did X as a shortcut to get this running, we will have to optimize this before we can do Y", which are totally fine and laudable.

However, we also have MR's where e.g. moving the mouse causes jank / slows updates down to <20 fps. Doing a paired review on those leads to the observations above: many developers simply don't know how to measure and optimize code, and even less how to estimate impact before writing that code. It would be easy to dismiss this as "bad developers", but I've seen it so many times over the last two decades that I think it runs deeper than that.

And then we all end up on HN with our favourite complaint: slow bloated Electron apps - except VSCode which is fast. The problem is not Electron, it's a systematic lack of knowledge and incentives about performance in the field.

Re:These are called opportunities by yellowapple on Friday December 04, 2020 @02:51AM (#25300042)
> slow bloated Electron apps - except VSCode which is fast

Is it, though? I'll give VSCode credit for being better than your average Electron app, but it (and Azure Data Studio, which last I checked is based on VSCode) ain't exactly a speed demon, either. Then again, I'm typically running something like Emacs, which is a lot lighter-weight (at least before I blow up ~/.emacs.d), so I'm probably just spoiled :)

It's certainly faster than Visual Studio, but it also has far fewer features.

Re:These are called opportunities by webmaven on Thursday December 03, 2020 @10:53AM (#25290053)
> And then we all end up on HN with our favourite complaint: slow bloated Electron apps - except VSCode which is fast. The problem is not Electron, it's a systematic lack of knowledge and incentives about performance in the field.

Has anyone ever done an analysis of what exactly VSCode does differently than a typical Electron app? Where it deviates from the garden path?

Re:These are called opportunities by WJW on Thursday December 03, 2020 @07:40AM (#25288268)
Can't say anything about this particular case but one possible cause is that the devs have looked around, seen which behaviours are likely to result in promotion/pay raises and have determined that performance work is not one of them.