logoalt Hacker News

haeseongtoday at 2:12 PM2 repliesview on HN

A `bool profile` branch stays expensive even when it predicts perfectly, because it bloats every opcode handler, and on a computed goto interpreter that extra code messes with the branch predictor history each dispatch site builds up, which is the whole reason dispatch is fast. Swapping the entire table dodges that. The part I like is fanning every opcode into one recording instruction and then back out through the real table, which is what keeps the second table from turning into a whole second interpreter like the earlier approach did.


Replies

achieriustoday at 5:48 PM

Reading through this accounts other comments, it feels rather Claude-like. I wouldn't mention this if it weren't a consistent pattern