OK, here is what I believe is the final version of the Mapper code with support for wildcard matching.
The new code is approximately 14.7% faster, executing the 1,000,000 iteration test loop in 7480 ms versus 8772.5 ms for the original code, a difference of 1292.5 ms. Times were computed by executing the main() function 10 times, and recording the results. The median value was then calculated and used for reporting. For those interested, the times for the tests are below.
Here are the files:
HostMap.java - New File to act as a container for hosts. It contains searching methods to find hosts. http://www.mhsoftware.com/~gsexton/HostMap.java
Mapper.diff - Diff between 5.5.9 mapper and the current one. Because of the abstraction of the host mapping into a new class it's not super useful, but included for completeness. http://www.mhsoftware.com/~gsexton/Mapper.diff
Mapper.java - Complete, modified Mapper.java file. http://www.mhsoftware.com/~gsexton/Mapper.java
Harness_output.diff - Difference between the test harness output using the 5.5.9 code, and the modified code. http://www.mhsoftware.com/~gsexton/harness_output.diff
Once I sort out the correct method of setting the default # of Alias Matches, I will submit the complete set as a diff. Unless someone else want to do the parameter setting. Right now the default # of alias matches is hard-wired to 16.
Some people have asked me to integrate the test harness into a Junit testing module. Unfortunately, I don't have any experience w/ Junit, so I don't think I would be a good candidate for this.
There's one final thing. During previous discussions, it was kind of hinted I should put the alias match limiting in the Connector. It seems kind of ugly since this seems to apply at the host or alias level. Does anyone have thoughts on this?
For testing purposes, a P3 600 Mhz running SUSE Linux 9.2, w/ JDK 1.4.2_06-b03 was used.
I like it to some extent (haven't fully verified it, though), but I'm still not hot about adding the newly "found" hosts to the host list. Even if it's slower, I think I'd prefer a separate prefix matching step, since filling the list with new hosts is likely going to create problems and add special cases (ex: managing hosts when you have a host as www.foo.com and another less relevant *.foo.com).
For exact matches (which is done in a few places inside Tomcat), using hash codes might work a bit faster, so it could be beneficial.
Rémy
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]