News for hackers. Stuff that matters.
Re:Dirty tricks 6502 programmers use by LarryMade2 on Sunday August 18, 2019 @07:30PM (#20733625)
There can be a significant trade-off on size vs speed, the more tricks you do to shave down bytes usually adds to the complexity of the iterations.

So assembly programmers may go for the more kludgy looking code as the execution far outpaces the optimized byte count version. Ive heard of such things in video timing and game loops.

Re:Dirty tricks 6502 programmers use by jwr on Sunday August 18, 2019 @07:45PM (#20733689)
This really depends on the specific architecture and the application. In some cases, you will want to optimize mostly for size, so that your hotspots fit entirely into I-cache. Modern CPUs spend most of their time waiting for data (or instructions) to become available, so often computations are essentially free.
Re:Dirty tricks 6502 programmers use by gpderetta on Monday August 19, 2019 @06:43AM (#20736613)
the average IPC over a variety of loads is, IIRC, estimated to be ~1. So no, most modern cpu do not spend most of their time waiting for data.
Re:Dirty tricks 6502 programmers use by ddingus on Monday August 19, 2019 @01:05AM (#20735021)
Screen blitting is a frequent unroll for speed case, often combined with self modifying code to make compiled sprites.