2 ms·
Does this only get rid of unused binaries? Or is the system smart enough to use the profiling infrastructure to identify dead code in general?
by charcircuit 4y ago
Does this only get rid of unused binaries? Or is the system smart enough to use the profiling infrastructure to identify dead code in general?
- Jolter 4y agoJust read the article. It’s not that long.
- charcircuit 4y agoI was hoping to spark a conversation about this approach as no such thing was mentioned in the article even though it should be possible to do. The whole point of these comment sections is to have a discussion. If the point of this site was just to read articles there wouldn't be a comment section.
- Jolter 4y agoI think your question was phrased in a way that suggested you had not understood the article. The described system detects unused libraries and binaries, but does not seem to look for dead code paths in source files. Dead code path detection is an interesting topic which I think the linked article doesn’t address at all.
- kccqzy 4y agoProfiling is inherently probabilistic and I don't think it should be used. Anything that inspects the runtime (dynamic) behavior of code isn't good enough for a code deletion tool. Only static analysis will do.
- charcircuit 4y ago>Profiling is inherently probabilistic And with enough samples we can learn what code paths are being taken. You can have your dead code bot look at the number of samples that have been collected to know if it should be enabled for something. For example if you have 6 mounths worth of samples of a piece of software running on 10k machines you will get a good idea on what code isn't being used. >Anything that inspects the runtime (dynamic) behavior of code isn't good enough for a code deletion tool. I disagree since the code that is being run is by definitions not dead code.
- joshuamorton 4y agoOn the other hand, this may mean you accidentally delete things like code that gracefully handles rare errors.
- charcircuit 4y agoWhen the developer reviews the CL they can use their judgment to determine if the proposed deletion makes sense. The bot can remember not to send a CL for that same code in the future.
- joshuamorton 4y agoYes, but then you run into signal-to-noise issues. It's much easier when I can trust that 90 or 95 or 99% of the automatic deletions will be legitimate, than if only 50% or 20% are, then they become an annoyance.
- UncleMeat 4y agoThis is hyper dangerous. People are prone to accepting robot CLs and even a small error rate of deleting important code will be a big problem. GWP is also only able to instrument a very small number of requests.
- charcircuit 4y ago>This is hyper dangerous It sounds like the same issue exists with this approach of removing unused libraries and binaries that have not been run in a while. My suggestion is just expanding it from binaries that haven't run to libraries that haven't run. You could even just put this information into some code health dashboard. If code isn't run that means that it isn't providing value or it isn't being tested in production. How can you be sure some rare failure case actually works and doesn't take down the system if you never test it out to see if it works. >GWP is also only able to instrument a very small number of requests. As I mentioned before this could be limited to popular services where it is enabled and where a small number of a giant number of requests is still a big number.