An optimization thoughtToday's random optimization thought, brought to my mind by the process of trying to make DWiki run slightly faster:
Caches are the degenerate brute force case of this, but program restructuring is better. Repeatedly calling the same core routine can be a sign that the upstream interfaces aren't really doing what higher levels want, so the higher levels have to do redundant work. Besides, if you can figure out a way to call something less you don't have to worry about cache invalidation. For example, DWiki's routine to get a page from the file store used to
first call (The 'is this a valid path' routine is simple and small, but it got called enough to turn up in profiles. DWiki can do a lot of path lookups; with a couple of tweaks, a typical page dropped from 144 calls to 105.) |
These are my WanderingThoughts GettingAround This is part of CSpace, and is written by ChrisSiebenmann. * * * Atom feeds are available; see the bottom of most pages. Categories: links, linux, programming, python, snark, solaris, spam, sysadmin, tech, unix, web |