Live data from Hacker News

The computers are fast, but you don't know it

shvbsle.in

31–40 of 819 posts

Re: The computers are fast, but you don't know it

#31
post #6

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…

I upgraded a desktop machine the last time I visited my family. It was a Windows 7 computer that was at least 10 years old with 4GB of ram. They wanted to use it online for basic web browsing, so I thought I'd install Windows 10 for security reasons and drop in a modern SSD to upgrade the old 7200rpm drive to make it more snappy. Well, it felt slower after the "upgrade". Clicking the start menu and opening something…

Let the caches warm up a little!

Re: The computers are fast, but you don't know it

#32
post #6

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…

Back in time all you needed for perfect performance is to use C and proper algorithms. It was easy. Nowadays you need vector operations, you need to utilise GPU, you need to utilise various accelerators. For me it is black magic.

I think you're trying too hard.

Something that you do a lot? Fine, write it in C/C++/Rust.

It's something that costs thousands/millions of dollars of compute? Ok, maybe it's worth it for you to spend a month on, put your robe on, and start chanting in latin.

Re: The computers are fast, but you don't know it

#33

I wonder how much power (and resulting CO2 emissions) could be saved if all code had to go through such optimization. And on a slightly ranty note, Apple's A12z and A14 are still apparently "too weak" to run multiple windows simultaneously :)

Worse CO2 emissions. You think optimizations are energy free?

Re: The computers are fast, but you don't know it

#34
post #18

Hmm, interesting that single threaded C++ is 25% of Python exec time. It feels like C++ implementation might have area for improvement. My usual 1-to-1 translations result in C++ being 1-5% of Python exec time, even on combinatorial stuff.

I recently ported some very simple combinatorial code from Python to Rust. I was expecting around 100x speed up. I was surprised when the code ended running only 14 times faster.

Just to be sure, you did compile the Rust program using the --release flag?

Re: The computers are fast, but you don't know it

#36
post #6

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…

I upgraded a desktop machine the last time I visited my family. It was a Windows 7 computer that was at least 10 years old with 4GB of ram. They wanted to use it online for basic web browsing, so I thought I'd install Windows 10 for security reasons and drop in a modern SSD to upgrade the old 7200rpm drive to make it more snappy. Well, it felt slower after the "upgrade". Clicking the start menu and opening something…

That's interesting, I cloned a Win10 installation on a HDD to a sata SSD a year or two back and the speed difference was considerable. Especially something like Atom that took minutes to open before was ready to go in like 10 seconds afterwards.

A lot of things remained slow though.

Re: The computers are fast, but you don't know it

#37
1. There's no real limit to how slow you can make code. So that means there can be surprising large speedups if you start from very slow code.

2. But, there is a real limit to the speed of a particular piece of code. You can try finding it with a roofline model, for example. This post didn't do that. So we don't know if 201ms is good for this benchmark. It could still be very slow.

Re: The computers are fast, but you don't know it

#38

Did the author beat pandas group an aggregate by using standard Python lists?

Most likely a missued of Pandas. DF are heavy to create, but calculations on them are fast if you stay in the numpy world and stay vectorized.

Yeah, I'm a bit suspicious that they made two simultaneous changes:

  1. remove pandas
  2. externalize WEIGHTS and don't generate it every run
Point 2 is likely a huge portion of the runtime.

Re: The computers are fast, but you don't know it

#39

Earlier quoted context omitted.

That's true for everything in computing. Don't use a hammer as a screwdriver. I'm not even implying they shouldn't have used pandas for this, I'm suggesting they probably wrote the wrong pandas code for this. Pandas is typically 3 times faster than raw Python, not 10 times slower.

No, I think it is fair to call out mediocrity, even when it tries to pull the "disclaim exactly the set of specific applications it gets called out on" trick. Sure, pandas often beats raw python by a bit, but come on, there's so much mediocrity between the two that I doubt they even had to cheat to find a situation the other way around.

I wish for myself to create any project in my life that reach twice this level of mediocrity then.

Re: The computers are fast, but you don't know it

#40
post #28

Earlier 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.

Power Designer surely is phoning home but this isn't nearly slow enough to matter here. AFAIK Visual Studio phones in during the operation, and not on startup. Libre Office almost certainly isn't phoning anywhere.

I didn't include the slowest starting software that I know, Oracle SQL Developer, because it's clear that all the slowness is caused by phoning home, several times for some reason. But that's not the case for all of them.

EDIT: Or, maybe it's useful to put it another way. The slowest region on the world for me to ping is around Eastern Asia and Australia. Some times, I get around 1.5s round trip time for there. A minute has around 40 of those.

Post reply on HN