I'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…
> And in the end, the code seems to run "fast enough" and nobody involved really notices that what is running in 750ms really ought to run in something more like 200us. Nobody has created a language that is both thousands of times faster than Python and nearly as straightforward to learn and to use. The closest thing I know of might be Julia, but that has its own performance problems and is tied closely to its AI/ML…
The computers are fast, but you don't know it
411–420 of 819 posts
Re: The computers are fast, but you don't know it
#412Article says at one point, "We have reduced the time for the computation by ~119%!", which is impossible. If you reduce it by 100% it is taking zero time already.
Re: The computers are fast, but you don't know it
#413Earlier quoted context omitted.
I agree except for the Python bit, which is factually wrong. Python allows you to program as if you’re a jazz pianist. You can improvise, iterate and have fun. And when you found a solution you just refactor it and use numba. Boom, it runs the same speed as a compiled language. I once wrote one little program that ran in 24 min without numba and ca. 8 seconds with numba.
Dozens of instances of a C GUI can launch in the time it takes to launch a hello world python program.
I'd be the first to complain about latency where it maters, but launching a Python program is perceptually instant (and significantly lower-latency than many nominally "faster" languages, IME).
Re: The computers are fast, but you don't know it
#414Article says at one point, "We have reduced the time for the computation by ~119%!", which is impossible. If you reduce it by 100% it is taking zero time already.
Re: The computers are fast, but you don't know it
#415Earlier quoted context omitted.
The thing that did for me is realizing that people on opposite sides of the United States can't play music together if it requires any rhythmic coordination, even with a true speed-of-light signal with no other sources of latency.
jamtaba and ninjam are an open source solutions to this problem. They allow you to buffer everyone's playing, at a user specified interval, then replays the last measure of music to everyone. It's definitely not the same as live playing, but it's still pretty fun, and actually forces you to get creative on different ways. https://jamtaba-music-web-site.appspot.com/
Re: The computers are fast, but you don't know it
#416Earlier quoted context omitted.
It can complete many multiplications in that time, especially if you factor in parallelism. An 8-core machine using AVX-512 could do a few thousand 32-bit multiplications in that time. Your GPU can do tens of thousands, maybe hundreds of thousands depending on the model.
Or another way to look at it - the computer can do an absolute insane amount of math in the time it takes to roundtrip a single byte to the datacenter in US-West.
Re: The computers are fast, but you don't know it
#417most likely misused pandas / numpy,as long as you stay in numpy land,it is quite fast.
Use C or C++ or Rust or even Java and you don't have to worry about any of this. You can just write the obvious thing with your normal set of tools and it will be good enough.
Re: The computers are fast, but you don't know it
#418I'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…
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…
Re: The computers are fast, but you don't know it
#419Article says at one point, "We have reduced the time for the computation by ~119%!", which is impossible. If you reduce it by 100% it is taking zero time already.
That branch predictor is working really well!
Of course multiply this by the sheer number of calculations and even that little misprediction results in huge differences. The reality is actually quite sobering: a computer mostly calculates the same thing over and over.
Re: The computers are fast, but you don't know it
#420Earlier quoted context omitted.
I have an M1 Air right I'm typing on right now and have not had any sluggishness concerns besides when switching between Spaces. Even that is more of a visual stutter instead of actually lagging to the point the animation takes longer than usual. This is the first thin & light computer I've owned that I'm 100% happy with its performance.
Switching between spaces on this M1 takes multiple seconds. It's almost unbearable. My 8-core 64GB Windows machine fares no better. Switching between OLVWM desktops on my 200MHz Pentium Pro twenty years ago was instantaneous.