Earlier quoted context omitted.
I agree 100%. I wish every software engineer would spent at least a little time writing some programs in bare C and running them to get a feel for how fast a native executable can start up and run. It is breathtaking if you're used to running scripting languages and VMs. Related anecdote: My blog used to be written using Jekyll with Pygments for syntax highlighting. As the number of posts increased, it got closer and…
> I agree 100%. I wish every software engineer would spent at least a little time writing some programs in bare C and running them to get a feel for how fast a native executable can start up and run. It is breathtaking if you're used to running scripting languages and VMs. Conversely when 99.9% of the software you use in your daily life is blazing fast C / C++, having to do anything in other stacks is a complete exer…
The computers are fast, but you don't know it
81–90 of 819 posts
Re: The computers are fast, but you don't know it
#82Yup. We have gotten into the habit of leaving a lot of potential performance on the floor in the interest of productivity/accessibility. What always amazes me is when I have to work with a person who only speaks Python or only speaks JS and is completely unaware of the actual performance potential of a system. I think a lot of people just accept the performance they get as normal even if they are doing things that ta…
If you stick to only doing arithmetic and avoid making lots of small objects, javascript engines are pretty fast (really!). The tricky part with doing performance-sensitive work in JS is that it’s hard to reason about the intricacies of JITs and differences between implementations and sometimes subtle mistakes will dramatically bonk performance, but it’s not impossible to be fast.
People building giant towers of indirection and never bothering to profile them is what slows the code down, not running in JS per se.
JS, like other high-level languages, offers convenient features that encourage authors to focus on code clarity and concision by building abstractions out of abstractions out of abstractions, whereas performance is best with simple for loops working over pre-allocated arrays.
Re: The computers are fast, but you don't know it
#83On mobile devices it is more serious than just bad craftsmanship & hurt pride, bad code is short battery life. Think mobile game that could last 8 hours instead of 2 of it wasn’t doing unnecessary linear searches on timer in JavaScript.
By the next morning, I'd found it was doing an O(n^2) operation that, while probably sensible when the app had first been released, was now totally unnecessary and which I could safely remove. That alone reduced the 20 minutes to 200 milliseconds.
(And this is despite that coworker repeatedly emphasising the importance of making the phone battery last as long as possible).
Re: The computers are fast, but you don't know it
#84Re: The computers are fast, but you don't know it
#85Earlier quoted context omitted.
It's not only a matter of 750ms instead of 200ms. I'm astonished every time I open some tool like Visual Studio, SAP Power Designer, or Libre Office that can stay for the most part of a minute on its loading screen. What do those tools even do for that long? They can read enough data from the disk to overflow my computer's main memory a few times during it.
Phone home. I suspect much of the lag is network latency.
Re: The computers are fast, but you don't know it
#86Did the author beat pandas group an aggregate by using standard Python lists?
Yes. Apparently they have used Python lists to beat highly optimized library which builds upon numpy, in C. Yeah right. Note that I'm not saying that their second version of the code wasn't faster, just that this has nothing to do with python vs. pandas.
Re: The computers are fast, but you don't know it
#87I wonder if eventually there is going to be consideration for environment required when building software. For instance running unoptimised code can eat a lot of energy unnecessarily, which has an impact on carbon footprint. Do you think we are going to see regulation in this area akin to car emission bands? Even to an extent that some algorithms would be illegal to use when there are more optimal ways to perform a t…
it has thankfully started: https://www.blauer-engel.de/en/productworld/resources-and-en...
I think KDE's Okular has been one of the first certified software :-)
Re: The computers are fast, but you don't know it
#88I've been lightly banging the drum the last few years that a lot of programmers don't seem to understand how fast computers are, and often ship code that is just miserably slower than it needs to be, like the code in this article, because they simply don't realize that their code ought to be much, much faster. There's still a lot of very early-2000s ideas of how fast computers are floating around. I've wondered how m…
Python allows one to save development time in exchange for execution time
Re: The computers are fast, but you don't know it
#89Re: The computers are fast, but you don't know it
#90On a 3GHz CPU, one clock cycle is enough time for light to travel only 10cm. If you hold up a sign with, say, a multiplication, a CPU will produce the result before light reaches a person a few metres away.