HACKER Q&A
📣 is_true

Is there a code golf community but for performance instead of size?


I like code golf because you usually can learn more about a language, but I think focusing on performance might be a better use of time.


  👤 karmakaze Accepted Answer ✓
Advent of Code progresses to the point where simple/brute force solutions fail to work and you have to use better datastructures/algorithms.

Other performance work has dependencies tending to be tied to a database, networked services, etc that's not so bite-sized and sharable.

My early descent into programming was constantly battling with performance getting a 1.79 MHz Atari 8-bit to do interesting things in a 1/30 second. Maybe retrocomputing and writing software for vintage machines or recreated new machines that work like them might be a good challenge.


👤 syntheweave
PICO-8 is a good competitive ground for performance coding: it's Lua, but with intentional limiters on size, performance, and source token counts. Writing good PICO-8 code generally means code golfing, with the side effect of the performance limiters being designed to make small code also be fast code - so optimizations are often whole-program.

Real-world performance on modern hardware is often a lot more dull and consists of finding the inner loops, parallelizing what you can, organizing the data to be cache friendly, then getting the loop fast at instruction level. You don't learn the same lessons from that because the majority of the codebase is "dark" and run too infrequently to show up as a bottleneck.


👤 082349872349872
Unlike code drag racing, code golf can be scored independently of the hardware substrate.

(a supercomputer is a device that turns your compute-bound job into io-bound; a mainframe turns io-bound jobs into compute-bound)


👤 exabrial
How about one for maintainability?

👤 db48x
See also “Someone improved my code by 40,832,277,770%” <https://m.youtube.com/watch?v=c33AZBnRHks> by Matt Parker. It can be a really fun game!

👤 mejutoco
Leetcode tells you if you are in the top x% in terms of speed. It might scratch that itch.

👤 zzo38computer
Such a thing can be used in specific systems e.g. NES/Famicom, or the original IBM PC with 8088, but I think not for portable code.

👤 joshu
Computer science in general?