Hacker Newsnew | past | comments | ask | show | jobs | submit | abbeyj's commentslogin

Try examining the old entries from the https://en.wikipedia.org/wiki/Underhanded_C_Contest.


You would have to give the compiler some help to allow it to auto-vectorize this. Warning, untested: https://godbolt.org/z/b358bMWzG. This unrolls the loop by 16 times. The trick is using `&` instead of `and` so that there's no short-circuiting. All 16 elements are read on each iteration of the loop. This gives the compiler the freedom to replace these reads with a single 16 byte load.

> compilers will never auto-vectorize loops with an early loop break afaik.

I think this is changing. https://godbolt.org/z/ea1E7dx9v. GCC 14 won't try to vectorize this because of the break statement. But GCC 15 does vectorize it. This got a callout in the "General Improvements" section of the release notes: https://gcc.gnu.org/gcc-15/changes.html

I don't think there's any equivalent in clang/LLVM.


I'm not clear on why there is `ip++` in the RECORD_INST handler. We've already moved to the next instruction by running `ip++` at the end of the handler in the normal dispatch table. In the RECORD_INST handler we do the work to record the instruction but don't do the actual work of that instruction. We can't, because we only have the one handler that has to work for all instructions. Shouldn't we jump to DISPATCHER_TABLE_NORMAL without incrementing ip again?



Indeed, my point was not all chips do well with Desktop application loads.

People were bad at handling parallelism with ia64, and still have problems today on better amd platforms with less janky compilers.

The fact an $800 chip still can beat a $14000 chip at some tasks probably should tell people something about concurrency scaling overhead. =3


EPIC was Explicit Parallel Instruction Computing, the underlying engineering architecture of AI-64. Epyc is an AMD brand name.

And pivoting to concurrency on a rescheduler-intensive core as opposed to concurrency on a scheduler-based core isn’t very pertinent, particularly since we have 25 years of Moore’s Law between then and now.


"AI" responses are silly, and optimal 24 core count efficiency premise in Desktop applications offer diminishing returns on a highly concurrent 32/64/192 core Epyc line of OoO chips...

How many strings does a Bass play with in water? =3


They might have been inspired by a similar feature in previous chips, like the external video support in the TMS9918: https://en.wikipedia.org/wiki/TMS9918#External_video.

If they had extra pins that they had no use for, I'm sure this would have seemed like a very easy and cheap addition. You take 4 unused pins and add 4 pulldown resistors. Then when you go to draw the background, instead of using index 0, you take the value for the index from those pins.

Maybe they planned to use this in arcade hardware, where you'd have a bigger budget than a home console and could afford two PPUs. Then you'd get more colors, and you could scroll the background layer independently from the foreground layer. I believe they later added support for independent layers on the SNES hardware so this type of thing was probably already in demand from game designers.


The one that immediately springs to mind is C#. Of all the mainstream languages it is probably the one most similar to Java. It can be compiled into platform-independent bytecode (like Java) or into native code using Native AOT. Relevant to the subject of this article, it has had support for structs (user-defined value types) since C# 1.0 in 2002.


> The Python one-liner is there because most modern shells refuse to create a non-UTF-8 filename for you.

Both `echo -ne 'weird\xffname\0' > list0` and `printf 'weird\xffname\0' > list0` seem to work fine for me on Linux. Is this macOS-specific?


> Both `echo -ne 'weird\xffname\0' > list0` and `printf 'weird\xffname\0' > list0` seem to work fine for me on Linux. Is this macOS-specific?

Neither of those create a non-UTF-8 filename. (Both files are named "list0", which is valid UTF-8.) They have non-UTF-8 content, but that's not weird.

But it's not too hard to get a non-UTF-8 filename:

  touch $'\xff'
Both zsh & bash support that syntax.

(You could also use process substitution with printf, but that's more steps than necessary. So, something closer to your example would be,

  touch "$(printf '\xff')"
You can't put a \0 in the filename, as there's no way to pass that string in C.)


I'm a bit confused about the colors used in the CPU graphs. In the first graphs it looks like green means that the application is running and red means that the GC is running. But once we get to Figure 4 then red means the GC is running (on the GC threads) or nothing is running (on the Main thread)? If red always means that GC work is being done on that thread then this is inconsistent with the text that says "By distributing reclamation work across both cores..." since we would have three threads running at once. Once you move to the concurrent GC figures you definitely have three things running at once. Unless you're assuming SMT with each core running two threads?

In Figure 3 you somehow have 101% wall time. :)


Thanks for the detailed read and the great questions!

Regarding the colors and thread counts in Figure 4: the key piece of context here is that the application thread (the Main thread) is completely paused during this phase. It isn't actually running anything at all. Because the application is halted, only the GC threads are doing active work. Therefore, rather than three threads running at once, we strictly have two things running concurrently. This is a helpful piece of feedback and I'll make sure to make this clearer in future writings.

Good eye on the 101% wall time. That was due to a minor bug in my plotting script that specifically affected the GC plots with no concurrent time. I have corrected this and updated the post. The fixed plot should be visible on the site in a future near you just as soon as the edge caches invalidate.


Doing both of those things does seem to help: https://godbolt.org/z/1vv7cK4bE

GCC trunk seems to like using `bool` so we may eventually be able to retire the hack of using `int`.


That would probably be difficult at optical wavelengths. At radio wavelengths you might have a better shot, but we can build radio interferometric telescopes on Earth and since the atmosphere is relatively transparent at radio frequencies, you probably aren't going to get any advantage by trying to build one in Earth orbit.

Though not the same thing, you may be interested in https://en.wikipedia.org/wiki/Laser_Interferometer_Space_Ant...


There is a mission concept for a far-infrared interferometer: https://asd.gsfc.nasa.gov/spice/

One would need to go to space for that of course.


>you probably aren't going to get any advantage by trying to build one in Earth orbit.

People want to put a radio telescope on the far side of the moon, so that it doesn't have interference from terrestrial RF sources:

https://en.wikipedia.org/wiki/Lunar_Crater_Radio_Telescope

...and your spatial resolution is proportional to the size of your telescope. So you could have really high resolution if you speckled your interferometric telescope array units around L1, L2, L4, and L5.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: