4 ms·
Why not use a plain text file that could be read when the program (or the computer) starts with options written in human-readable form? Reading a symlink is on
by cperciva 17y ago
Why not use a plain text file that could be read when the program (or the computer) starts with options written in human-readable form?
Reading a symlink is one system call. Reading a file is three or more system calls. There is an overhead cost for each system call -- and if you're going to be doing something for almost every process, you might as well be as efficient as possible.
- rbanffy 17y agoExcept that if you were using a text file, you use different flags or turn it on or off on a per executable file basis checked on process start and would not have to re-parse the symlink every time you malloc something.
- cperciva 17y agoThe symlink is only checked when malloc is first called.
- rbanffy 17y agoThen why parsing a human-readable file that could, conceivably, activate a much richer debugging option-set is such a huge overhead as to make the symlink way a better option? Is the setting system-wide or process-wide? Sorry, but I just can't see why it would be a better option.
- silentbicycle 17y agoIt's checked when malloc initializes, so the startup cost for a more complex method would have to be paid by nearly every process system-wide.