Todo "dpid_idle_timeout variable to dpidrc" and config parsing generally
Hello all, In dpid/dpid.c at about line 204, there is a todo, that dpid_idle_timeout should be configurable. I looked at how to do this sympathetically with the existing code and blocked, because the configuration file is: - having its location calculated - being opened - being scanned into heap memory several times in the existing code. My over-response is to write a library to: - private memory-map it - parse it into a linked-list in the comments in the file and - have everyone who traversed the file now traverse the linked-list On the way, we get new functionality: - the ability to record the use of a configuration item - the ability to report on unused configuration items -- which are interesting because they're probably typos Parsing dillorc with the default options uncommented, this approach is about 4* faster than the existing approach. I think that it will also have a smaller VM footprint, because we are already paying for cooked disk buffers for the same amount of file, more times. The diff is 1400 lines, so I don't expect instant rejoicing :-) The attached file contains my test-cases, shell scripts to generate some of them, that are tricky, and the diff which inserts the code into revision b185e43. Regards, James.
participants (1)
-
james.from.wellington@gmail.com