| ▲ | pclmulqdq 5 days ago |
| -O3 -march=haswell The second one is your problem. Haswell is 15 years old now. Almost nobody owns a CPU that old. -O3 makes a lot of architecture-dependent decisions, and tying yourself to an antique architecture gives you very bad results. |
|
| ▲ | arthur2e5 5 days ago | parent | next [-] |
| The author gives a godbolt link. It takes 5 minutes to add two compilers on raptorlake and see that it gives the same result. https://godbolt.org/z/oof145zjb So no, Haswell is not the problem. LLVM just doesn't know about the dependency thing. |
| |
| ▲ | hedora 4 days ago | parent | next [-] | | Also, if you’re building binaries for redistribution, requiring Haswell or newer is kind of an aggressive choice. I have a box that old that can run image diffusion models (I upgraded the GPU during covid.) My point being that compiler authors do worry about “obsolete” targets because they’re widely used for compatibility reasons. | | |
| ▲ | sgerenser 2 days ago | parent [-] | | "Haswell or newer" is a bit misleading here, because there were low-end Celerons and Pentiums shipped for years after the release of Haswell that lacked AVX2 and wouldn't be able to run software compiled for -march=haswell. |
| |
| ▲ | pclmulqdq 4 days ago | parent | prev [-] | | Oh, yeah. Looking at the code the comparison function is bad in a way that will hit issues with cmovs. The "else if" there is a nearly 100% predictable branch which follows a branch that's probably completely unpredictable. One optimization you get with -O3 is that branches not marked likely or unlikely can be turned into dataflow. The proper ordering for that code is to pull the equality check forward into an if statement and mark with "unlikely" if you're using -O3, and then return the ordering of the floating point comparison. Since we're using Rust there's some decent syntactic sugar for this function you can use instead: let cmp = |other: &Neighbor| -> Ordering {
other.dist.partial_cmp(&neighbor.dist).unwrap()
.then_with(|| other.id.cmp(&neighbor.id))
};
You probably won't get any CMOVs in -O3 with this function because there are NaN issues with the original code. |
|
|
| ▲ | mgaunard 4 days ago | parent | prev | next [-] |
| My desktop computer is a Sandy Bridge from 2011. I still haven't seen any compelling reason to upgrade. |
| |
| ▲ | alberth 4 days ago | parent | next [-] | | What factors would be compelling to upgrade for? Just curious, since perf alone doesn’t seem to be the factor. https://browser.geekbench.com/processors/intel-core-i7-2600k https://browser.geekbench.com/processors/intel-core-i9-14900... | | |
| ▲ | jpc0 4 days ago | parent | next [-] | | Because number bigger doesn’t translate to higher perceived performance… The only compelling reason that I want to upgrade my Sandy Lake chip is AVX2. So it is instruction set not perf, sure there will be improved performance but most of the things that are actually performance issues is already handed off to the GPU. On that note probably rebar and PCIe4 but those aren’t dramatic differences, if CPU is really a problem (renders/compilation) then it gets offloaded to different hardware. | | |
| ▲ | Aurornis 4 days ago | parent | next [-] | | > Because number bigger doesn’t translate to higher perceived performance… When the numbers are that far apart, there is definitely room to perceive a performance improvement. 2011 era hardware is dramatically slower than what’s available in 2025. I go back and use a machine that is less than 10 years old occasionally and it’s surprising how much less responsive it feels, even with a modern high speed SSD drive installed. Some people just aren’t sensitive to slow systems. Honestly a great place to be because it’s much cheaper that way. However, there is definitely a speed difference between a 2011 system and a 2025 system. | | |
| ▲ | hedora 4 days ago | parent | next [-] | | Choice of things like desktop environments matters a lot. I’m using xfce or lxde or something (I can’t tell without checking top), and responsiveness for most stuff is identical between 2010 intel and a ryzen 9. The big exceptions are things like “apt get upgrade”, but both boxes bottleneck on starlink for that. Modern games and compilation are the other obvious things. | | |
| ▲ | Aurornis 4 days ago | parent [-] | | > The big exceptions are things like… > Modern games and compilation are the other obvious things. I mean if we exempt all of the CPU intensive things then speed of your CPU doesn’t matter I don’t have a fast CPU for the low overhead things, though. I buy one because that speed up when I run commands or compile my code adds up when I’m doing 100 or 1000 little CPU intensive tasks during the day. A few seconds or minutes saved here and there adds up multiplied by 100 or 1000 times per day. Multiply that by 200 working days per year and the value of upgrading a CPU (after over a decade) is very high on the list of ways you can buy more time. I don’t care so much about something rendering in 1 frame instead of 2 frames, but when I type a command and have to wait idly for it to complete, that’s just lost time. |
| |
| ▲ | estimator7292 4 days ago | parent | prev | next [-] | | Believe it or not, "good enough" often is good enough. Regardless of how big the numbers are. | | |
| ▲ | Aurornis 4 days ago | parent [-] | | The comment claimed there wasn’t a perceivable difference That’s different than acknowledging that newer hardware is faster but deciding current hardware is fast enough |
| |
| ▲ | cassepipe 4 days ago | parent | prev [-] | | Especially on single core, everything is painfully slow. Tried to install linux on a ppc imac G5 five years ago and I had to admit that it was never going to be a good experience, even for basic usage |
| |
| ▲ | alberth 4 days ago | parent | prev | next [-] | | Agreed that if you’re not using NVMe (as example), that non-CPU upgrade will translate into the biggest perceived benefit. Then again, not many Sandy Bridge mobo supported NVMe. | | |
| ▲ | mgaunard 4 days ago | parent [-] | | I did get a PCI-Express to M2 adapter and installed an NVMe drive. That was indeed the biggest upgrade ever. |
| |
| ▲ | LtdJorge 4 days ago | parent | prev [-] | | I went from a Sandy Bridge (i5 2500k) to a Ryzen 9 3950x, and the perceived performance improvement was insane. You also have to take into account RAM and PCIe generation bumps, NVMe, etc. |
| |
| ▲ | genter 4 days ago | parent | prev [-] | | Not OP, but I'm on a 10 year old laptop. Only thing I'd want is a higher resolution display that's usable in daylight, and longer battery life. |
| |
| ▲ | bigstrat2003 4 days ago | parent | prev [-] | | For what it's worth, you may be pleasantly surprised by the performance if you upgrade. I went from an Ivy Bridge processor to a Zen 3 processor, and I found that there were a lot of real world scenarios which got noticably faster. For example, AI turns in a late game Civ 6 map went from 30s to 15s. I can't promise you'll see good results, but it's worth considering. |
|
|
| ▲ | ksec 4 days ago | parent | prev | next [-] |
| Not as old but I am still typing this on a MacBook Pro Early 2015 with a Broadwell CPU. It is doing pretty well with Chrome and Firefox, not so much with Safari. |
|
| ▲ | cassepipe 4 days ago | parent | prev | next [-] |
| I do. Had to replace the plastics of the laptop and the screen's definition is unacceptable but with Linux and a SSD it's still fine for basic computer usage.
Not my daily driver but kept it as a daily drivers for 10 years. |
|
| ▲ | wffurr 4 days ago | parent | prev | next [-] |
| The default is an even older instruction set. Maybe you meant to suggest -march native ? |
|
| ▲ | ericpauley 5 days ago | parent | prev [-] |
| This era of CPUs has held up surprisingly well. I built an Ivy Bridge desktop in 2012 that still sees daily productivity use (albeit with an NVMe and RAM upgrade). |