You should read my message more carefully. I re-wrote it. It's 15% faster than the current 5.5.9 code. Elapsed time drops from 8772 ms for the stock 5.5.9 code to 7383ms for the revised code.
You know, I bit my lip and re-wrote the algorithm, even though I think it's a case of pursuing performance mindlessly at the expense of maintainability. If anyone thinks I'm exagerating this, look at the code. There are re-implementations of binary search algorithms and case-insensitive comparisons. I spent several hours fine-tuning the code to yield a really, measurable performance increase. I am more than a little personally offended by your cavalier and autocratic attitude. You didn't even bother to read the first few paragraphs of my message. Yes, you can make use cases for anything, but a real thorn in my side as a commercial software developer using servlets is that hosting companies won't run servlet engines. I think that the things I am running into are the same problems any commercial hoster is going to run into. This is the same circle we went into a year ago when I griped that the management application was host oriented, and required a context installed in every virtual host. Just because someone want to do something with a product that you don't does not mean their reasons aren't valid, or that it's fair to use emotionally charged and dismissive terms to describe their position. George Sexton MH Software, Inc. http://www.mhsoftware.com/ Voice: 303 438 9585 > -----Original Message----- > From: Remy Maucherat [mailto:[EMAIL PROTECTED] > Sent: Wednesday, May 04, 2005 11:45 AM > To: Tomcat Developers List > Subject: Re: Code Submission - Wild Card Aliases > > George Sexton wrote: > > Rémy, > > > > I'll look at those. So far, I re-wrote the algorithm, and > I've got it > > improved. > > > > The old algorithm (5.5.9) takes 8772 ms on a P3 600 ( My > earlier timed > > reports were approximate but relative). > > > > My current version of the algorithm taks 7383 ms. This is > for the million > > iterations with about 15 hosts, and 6 or so contexts. The > improvement for 1 > > million iterations is 1389 milli-seconds, or about 15%. I > suspect most of > > the remaining time is in the context lookup now. > > > > The current algorithm is using a parallel int array of hash > codes which it > > uses to quickly find (using Arrays.binarySearch(int[],int)) > the array > > element, and then it does a string comparison using the > > CharChunk.equalsIgnoreCase() method for the final > comparison. I have handled > > the possibility of collision in the hash usage, so that is > not a concern. > > > > I believe the slow down in my initial attempt was not > caused by the HashMap, > > but caused by the call to CharChunk.toString() and the corresponding > > toLowerCase() to get the key. > > > > As far as feature bloat goes, that's relative. I look at > some of the current > > features and think "That must be a one in a thousand installations > > thing...". An example that comes to mind is the proxying > support. It comes > > down to what the person using it is doing. In my case, I'm > hosting 40 > > virtual hosts in one instance, on one machine (a P3 600). > In the near > > future, I'm probably going to be adding 5-10 virtual hosts > per month. I'm > > hoping that I'll be able to scale to 200 virtual hosts per > (newer, faster) > > server. > > > > The feature in my software that I need wild card aliases > for is this: We > > have a calendar application. Large customers with many > calendars are not > > comfortable with the sheer number of calendars that show to > the public, or > > they want to have one set of calendars show to one group of > public users, > > while another set of calendars show to another set of > public users. Our > > solution was to select the public calendars based on the > virtual host name > > of the request. In this way, training.foo.com would have one set of > > calendars, while marketing_events.foo.com can have a > different set of public > > calendars. Without wild-card aliases, I have to manually > add each alias they > > want to use to tomcat, and re-start the engine. This would > be painful for > > larger customers. > > > > Out of my 40 current customers, about 4 are going to > immediately start using > > the virtual host feature in my software. > > As I said, I do not want it. If you are not willing to make the > necessary revisions to your algorithm, I will not withdraw my -1. > > I maintain that this is almost bloat: you can obviously make > use cases > for vitually anything, which will be of no value for 99.9% of users. > > Rémy > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]