4 ms·
An upcoming part of the series discusses determining what work is necessary, at a very fine level, and working to remove all else. This may seem like a needlesl
by jknupp 14y ago
An upcoming part of the series discusses determining what work is necessary, at a very fine level, and working to remove all else. This may seem like a needlesly simplistic exercise, but consider the example you gave: the processes need to communicate with one another. The method by which they do so is an implementation detail. Even if they eventually use the files for another purpose, those are two separate requirements (the first to communicate with other processes and the second to journal that communication). Replacing file based communication with something like a simple TCP based message protocol would likely yield great dividends. For processes on the same machine, an IPC mechanism like domain sockets or shared memory would surely be faster.
Of course, the first thing to do is determine if increased performance is actually required. No sense in making something fast if no one benefits.
- nkurz 14y agoFor processes on the same machine, an IPC mechanism like domain sockets or shared memory would surely be faster. Why are you sure that these would be faster than reading and writing a file? There is a key truth to be mindful of while doing optimization work: programmers are, as a rule, terrible at anticipating at the cause of slowness in their application. This is counterintuitive but almost always true.