Live data from Hacker News

24-core CPU and I can’t move my mouse (2017)

randomascii.wordpress.com

31–40 of 255 posts

Re: 24-core CPU and I can’t move my mouse (2017)

#33
post #7
post #4

Earlier quoted context omitted.

Where are the mouse coprocessor equipped computers?

Hardware sprites (and presumably interrupts) made the Amiga mouse pointer move fluidly and responsively even when the CPU was busy. No complex graphics pipelines or laggy LCD screens to add further latency back then either.

I do miss aiming a particle accelerator at my brain as a HCI method.

Re: 24-core CPU and I can’t move my mouse (2017)

#34

I hold out forlorn hope that someday my modern workstation will achieve the responsiveness and fast boot times of my Commodore 128. Not joking in the least.

I have a long break over the holiday and am thinking of putting a software project out.

Do you think I should consider making it a priority to code in a fairly low-level programming language (e.g. Rust) without overhead, and count cycles so that most tasks are done within a single screen refresh?

I can't make the rest of users' systems more responsive but I could make my own software as fast and efficient as possible.

The other alternatives are Python, which would make it easier to ship large features but would come with a large overhead (full interpreter) since it's an interpreted language.

Re: 24-core CPU and I can’t move my mouse (2017)

#35

I hold out forlorn hope that someday my modern workstation will achieve the responsiveness and fast boot times of my Commodore 128. Not joking in the least.

I have a long break over the holiday and am thinking of putting a software project out. Do you think I should consider making it a priority to code in a fairly low-level programming language (e.g. Rust) without overhead, and count cycles so that most tasks are done within a single screen refresh? I can't make the rest of users' systems more responsive but I could make my own software as fast and efficient as possible…

Cycle-counting is useless on modern workstations, since different processor are used in each. I don't see how the choice of language is significant either, as long as it meets your goals for responsiveness. Goal could be instead to limit latency where possible (measuring time from click to completed action is easy with a framework), or communicate to the user when an action will take a noticable amount of time.

Re: 24-core CPU and I can’t move my mouse (2017)

#36

I hold out forlorn hope that someday my modern workstation will achieve the responsiveness and fast boot times of my Commodore 128. Not joking in the least.

I have a long break over the holiday and am thinking of putting a software project out. Do you think I should consider making it a priority to code in a fairly low-level programming language (e.g. Rust) without overhead, and count cycles so that most tasks are done within a single screen refresh? I can't make the rest of users' systems more responsive but I could make my own software as fast and efficient as possible…

I'd do it in C, but that's just me. If this is a one-person project you can hold you code to a high standard. Clean standard C11 with all warnings turned on (-Wall Wextra Wpendantic Wconversion). Write unit tests. Run them with valgrand/sanitizers. Use clang-format. Build with multiple compilers (GCC/clang/MSVC). ...

EDIT Not many hackers on hackernews apparently.

Re: 24-core CPU and I can’t move my mouse (2017)

#38
post #7
post #4

Earlier quoted context omitted.

Where are the mouse coprocessor equipped computers?

Hardware sprites (and presumably interrupts) made the Amiga mouse pointer move fluidly and responsively even when the CPU was busy. No complex graphics pipelines or laggy LCD screens to add further latency back then either.

Indeed - it's no deep magic, "all" you have to do is update the sprite's position from within the very same interrupt which reads the mouse counters. Oh, and make sure that nothing involved in that process can be paged out, ever. (The Amiga made sure of that by not supporting virtual memory!)

Re: 24-core CPU and I can’t move my mouse (2017)

#39
In the follow-up blog post (https://randomascii.wordpress.com/2017/07/27/what-is-windows...) he uses a sampler to try to find the bottleneck by looking at CPU instructions, but concludes:

> But the main thing I always realize when using this technique is that modern CPUs are weird and confusing. Because CPUs are massively out-of-order and super-scalar it is not at all clear what it means for a sampling interrupt to hit “on” a particular instruction. If an instruction is particularly expensive then samples are more likely to hit “near there” but I’m sure where “near there” actually is:

> If there are three instructions executing simultaneously when the interrupt fires then which one “gets the blame”?

> If a load instruction misses in the cache and forces the CPU to wait then will the samples show up on the load instruction, or on the first use of the data? Both seem to happen.

> If a branch is mispredicted then will the samples show up on the branch instruction or on the branch target?

> What’s going on with the expensive cmp instruction on line 24 of the spreadsheet?

> If anyone has a good model for what happens to the CPU pipelines when a sampling interrupt happens I would appreciate that. Ideally that would explain the relationship between clusters of samples and expensive instructions.

I have a distinct memory of reading a blog post probably 5-ish years ago where someone did just that. The author started with some microbenchmarks of very tight loops, and used some sort of profiler/perf counter tool that measured hit counts for each instruction of the loop. Then, they went into a deep dive into analyzing the instruction throughputs and latencies and dependency chains to demonstrate how bottlenecks at the CPU level manifested as clusters of samples, and how to use this information to optimize the loop.

Does anybody else remember this post, and possibly where I can find it? I’ve been in a couple situations where it would have been tremendously helpful, but I just haven’t been able to dig it up.

Re: 24-core CPU and I can’t move my mouse (2017)

#40

I hold out forlorn hope that someday my modern workstation will achieve the responsiveness and fast boot times of my Commodore 128. Not joking in the least.

Can still be done if all you want is a command-line to come up and be responsive.

Most folks want web, email, images, and even a bit of security from their computer today. Could always be faster, but I think the days of "bam!" ready are past due to those requirements. Unless the computer is only sleeping, like an iphone for example.

Post reply on HN