Live data from Hacker News

24-core CPU and I can’t type an email – part two

randomascii.wordpress.com

91–100 of 101 posts

Re: 24-core CPU and I can’t type an email – part two

#91

Earlier quoted context omitted.

Yes, ever since computers became "fast enough" developers have traded user's efficiency for their own. It's faster to write, but slower to run. The difference is that it's written once but run thousands or millions of times each day. It's distributed waste of resources, and it adds up.

The conservation of developer's time (and company money) at the expense of the users' time and money is the epitome of an externality. It's clear that we'd all be a bit better off if user's time was valued more. But who's going to pay to make that happen?

The users. If a person wants something, they buy it; if they don't, they don't; and if they didn't, they didn't.

A very simple and straightforward model of action. Yet it has fueled almost every major non-military-funded technological advancement since at least the Industrial Revolution, inclusive.

(And if you consider the military a very special customer who has been graciously granted the disposal of the entire nation's profits ... then they are no exception after all.)

Re: 24-core CPU and I can’t type an email – part two

#92
post #91

Earlier quoted context omitted.

The conservation of developer's time (and company money) at the expense of the users' time and money is the epitome of an externality. It's clear that we'd all be a bit better off if user's time was valued more. But who's going to pay to make that happen?

The users. If a person wants something, they buy it; if they don't, they don't; and if they didn't, they didn't. A very simple and straightforward model of action. Yet it has fueled almost every major non-military-funded technological advancement since at least the Industrial Revolution, inclusive. (And if you consider the military a very special customer who has been graciously granted the disposal of the entire nat…

Users could easily pay a few cents more to hire that competent dev to optimize, but there's a massive information problem that keeps the option from showing up.

Re: 24-core CPU and I can’t type an email – part two

#93

It's tangential here, but, seriously, let me ask: For those of us here with > 15 years in the business, when's the last time you really felt a BIG uptick in performance or responsiveness from a new computer upgrade? I buy a new laptop every 3-4 years, and I buy a nice one, but generally speaking I feel like we've been kind of flat in terms of usable power for a while. 6 or 8 years ago I switched to an SSD, and THAT w…

Oh, but booting is faster because systemd, remember? /s

This is literally the one thing "the systemd people" -- which is to say, Red Hat -- fell back on when their backs were to the wall after having their short list of sales pitch lies refuted. If none of the other supposed benefits were benefits or actually true, at least systemd would make our systems boot faster. Red Hat leaned on this hard throughout the process which culminated in the exclusively political decision (i.e. not based on merit) by the Debian TC chairman to completely replace existing init in "the rock-solid stability distro" with such unstable, buggy, immature software.

Here's a fun project idea: Plot the boot times of machines running systemd (and some control) over time, and I'm willing to bet you'll see a substantial increase in boot time immediately subsequent to the systemd decision by the Debian TC.

Re: 24-core CPU and I can’t type an email – part two

#94

Could you build on the always-unfair system along these lines? (C11ish, sorry) void do_work(the_work_t *w) { /* for simplicity here, rather than e.g. w->contenders */ static _Atomic int contenders = 0; contenders++; for ( ; work_remaining(w); ) { take_mutex(w->m); do_some_work(w); drop_mutex(w->m); if (contenders > 1) reschedule_this_thread(); } contenders--; } This depends on the OS providing a cheap and fast resche…

The trick is how you implement reschedule this thread. What you want in this specific case is to take it off-core long enough for another thread to wake up and take the lock. That is far too squishy a goal to be something that you can implement. If you sleep for some number of nanoseconds then you are wasting performance and/or not sleeping long enough. In this particular case the lock was a kernel lock in kernel cod…

I've been spoiled by a better OS. :D

How about:

  while work:
    if (contenders > 1)
       { reduce_priority; pri_reduced = true }
    take_lock
    if (pri_reduced)
       { unreduce_priority; pri_reduced = false }
    do_work_quantum
    drop_lock
   endwhile
(I mean empirically, although an educated guess would do).

Of course, if reducing priority is too fast, this likely doesn't help; alternatively it could be too slow and what you get back in system latency is taken away in lowered throughput. That's probably not OK if you don't need the system latency to be low.

I wonder if (dramatically, even) reducing the priority of some of the original workload exposing the problem, not just when racing for a lock but when doing the actual work quanta, would help. My thought here is that your email-sending is higher-prirority and will at least push some of the workload out of the way in reasonable time, giving you back some responsiveness.

I'm surprised if Windows doesn't offer up a high-throughput/latency-tolerant QOS for threads.

Re: 24-core CPU and I can’t type an email – part two

#95

Earlier quoted context omitted.

Oh, but booting is faster because systemd, remember? /s

This is literally the one thing "the systemd people" -- which is to say, Red Hat -- fell back on when their backs were to the wall after having their short list of sales pitch lies refuted. If none of the other supposed benefits were benefits or actually true, at least systemd would make our systems boot faster. Red Hat leaned on this hard throughout the process which culminated in the exclusively political decision…

But what are boot times like now compared to an init-based system after years of development?

Re: 24-core CPU and I can’t type an email – part two

#96

Earlier quoted context omitted.

"Looking at the wrong thing" is a matter of perspective. As a user, I couldn't care less that you saved money by writing a bloated web app. I care about the resources I have, which includes my own time, energy, money, computer, battery etc. In those terms, there are clear disadvantages to Electron based software.

See my response to a similar sibling comment: https://news.ycombinator.com/item?id=17826915 My basic point there being that losing a small number of users due to these concerns is probably worth it. I don't want to come across as someone who's hyper-defensive of Electron. I hate the fact that such a bloated piece of software has become the standard means for supporting cross-platform development. At the same time, I…

It's not quite that simple though, because plenty of high profile apps have gone through large rewrites from native to Electron. Skype is probably the biggest offender here, taking an app that was actually quite good and turning it into a steaming pile of crap.

Alternatively, we've got closed systems like Slack that are slowly and pervasively getting rid of open systems like IRC.

I'm really not sure that there's an engineering time advantage in taking a reasonably solid existing piece of software and rewriting it in Electron. Is the technical debt really that large?

Really, I think the problems we have are political, and not technical. I include things like NIH syndrome in that group.

Re: 24-core CPU and I can’t type an email – part two

#97

Earlier quoted context omitted.

The trick is how you implement reschedule this thread. What you want in this specific case is to take it off-core long enough for another thread to wake up and take the lock. That is far too squishy a goal to be something that you can implement. If you sleep for some number of nanoseconds then you are wasting performance and/or not sleeping long enough. In this particular case the lock was a kernel lock in kernel cod…

I've been spoiled by a better OS. :D How about: while work: if (contenders > 1) { reduce_priority; pri_reduced = true } take_lock if (pri_reduced) { unreduce_priority; pri_reduced = false } do_work_quantum drop_lock endwhile (I mean empirically, although an educated guess would do). Of course, if reducing priority is too fast, this likely doesn't help; alternatively it could be too slow and what you get back in syste…

Priorities don't help. They are only relevant if there are more runnable threads than CPUs. In my case I had lots of spare CPUs so both threads could run, regardless of priority.

A QOS does not directly help. The only thing I am aware of that can help is fair locks, or occasionally fair locks, so that the lock is given directly to the waiting thread, instead of being made available to all.

I have yet to hear of any other solutions.

Re: 24-core CPU and I can’t type an email – part two

#98
post #70

Earlier quoted context omitted.

This is heavily correlated with your age (or, as you put it, "years in the business".) We old-timers clearly remember the days of Moore's Law, or more precisely, the days when Moore's Law had a direct impact on single-processor performance. For me, every upgrade was at least a factor of two improvement to pretty much everything. It was a qualitative difference -- things that just didn't make sense to run were now rea…

It used to be that each generation of CPU was a significant performance jump. DOOM on a 386 was nearly unplayable. On a 486 it was perfect. Quake on a 486 was awful, was great on a Pentium, and was smooth as butter on a Pentium II. These days, each generation is less than 20% faster in single-core performance. My desktop at home is an i7-3770k. In a couple months, it'll be 6 generations out of date, and yet it's stil…

I'd hazard to venture that modern microprocessor improvements "seem" less for two reasons.

1) A lot of the "a ha" magic really has been figured out in microprocessor arch (e.g. pipelining, superscalar, multi-level caching).

Previously, we were reaping the benefits of process shrinks AND microarch epiphanies. Now, only a slower former and less powerful versions of the latter (e.g. branch predictor tweaks).

2) We're discounting the "performance" that has instead been allocated to power. Up until the P4, we had the benefit of just saying "more power!" in pursuit of performance.

Now, not only do we have a power budget to stay within, but we're actively trying to decrease power draw for the same workload in mobile parts.

So instead of getting something twice as fast, we get something that has battery twice is long (or however the math works out).

Re: 24-core CPU and I can’t type an email – part two

#99
post #98

Earlier quoted context omitted.

It used to be that each generation of CPU was a significant performance jump. DOOM on a 386 was nearly unplayable. On a 486 it was perfect. Quake on a 486 was awful, was great on a Pentium, and was smooth as butter on a Pentium II. These days, each generation is less than 20% faster in single-core performance. My desktop at home is an i7-3770k. In a couple months, it'll be 6 generations out of date, and yet it's stil…

I'd hazard to venture that modern microprocessor improvements "seem" less for two reasons. 1) A lot of the "a ha" magic really has been figured out in microprocessor arch (e.g. pipelining, superscalar, multi-level caching). Previously, we were reaping the benefits of process shrinks AND microarch epiphanies. Now, only a slower former and less powerful versions of the latter (e.g. branch predictor tweaks). 2) We're di…

> So instead of getting something twice as fast, we get something that has battery twice is long (or however the math works out).

We've essentially changed the metric of performance from "calculations per second" to "calculations per watt", which can be useful for mobile (battery life) and data centers (reducing heat and the need for massive air conditioners, plus the electric bill), but less useful for gamers that often need more single-core performance.

Re: 24-core CPU and I can’t type an email – part two

#100

It's tangential here, but, seriously, let me ask: For those of us here with > 15 years in the business, when's the last time you really felt a BIG uptick in performance or responsiveness from a new computer upgrade? I buy a new laptop every 3-4 years, and I buy a nice one, but generally speaking I feel like we've been kind of flat in terms of usable power for a while. 6 or 8 years ago I switched to an SSD, and THAT w…

When I fitted my laptop with 118GB Optane drive (intel 800p). My builds run twice as fast now. I wouldn't achieve this by swapping CPU.

What kind of builds are you doing? Some of my colleagues are running tests at work and are looking into what benefits the most.
Post reply on HN