> an executable that adaptively strips code and self-minifies over time as you run it
i wonder if a lot of the dead code paths are already eliminated at runtime by the branch predictors in modern CPUs/GPUs. of course it would make no difference for size on disk (which can be argued is mainly useful for code golf and edu these days), but it would be cool to get that feedback in some format without needing to exert any additional effort.
Branch predictors do not modify the code in memory. Dead code is still there; if you have a branch that is always taken, the predictor may remember that, but the wasted bytes following it are still using up your cache.
You can usually get the linker to either remove dead code or assist in its removal, though. "Nearly" dead code is the big pain (e.g. options that are never set but could be).
Do you know much about branch prediction? It seems pretty darn interesting. I'm just curious as to how something like that would work with a path that potentially has side-effects. I don't really know how things work very well at that level, so perhaps I'm misunderstanding something.
i wonder if a lot of the dead code paths are already eliminated at runtime by the branch predictors in modern CPUs/GPUs. of course it would make no difference for size on disk (which can be argued is mainly useful for code golf and edu these days), but it would be cool to get that feedback in some format without needing to exert any additional effort.