On 23 Oct 2010, at 16:48, Graham Leggett wrote: > Hi all, > > I am looking to improve per-request performance when you have an environment > with many (thousands of) Location sections, and looking at > ap_location_walk(), it looks like it is currently doing a simple linear > search of locations on every request, which is far from ideal. > > Ideally, I'd like to create an index of the location sec_dir and sec_url > array, by creating a tree of hashtables that will allow us to drill down to > the relevant locations as quick as possible. This will also allow us to > pre-merge many of the configurations at startup, instead of just at runtime > (obviously because .htaccess is parsed at runtime we won't completely > eliminate merging, but we will minimise it). > > If we're careful about what pools we use on startup, we can also free a lot > of the memory used in the initial configuration scan, keeping a copy of the > merged config, instead of a copy of each location's configs.
Nice idea if you can come up with a clean design. We have a bit of a history of optimisation leading to breakage. It might be easier if combined with revisiting the semantics of subrequests and - especially - internal redirects. But that's going to have knock-on effects on a lot of core features, such as mod_dir, mod_alias, etc. -- Nick Kew
