philwebb commented on issue #142: Defer creation of encodingToCharsetCache
URL: https://github.com/apache/tomcat/pull/142#issuecomment-470546205
 
 
   > Besides the 31ms startup time, it's still worse in every way compared to 
the current code.
   
   I'm really not sure what I'm supposed to do with a comment like that. As 
someone who's just trying to help contribute a fix for an identified problem, 
it really doesn't make me feel very welcome :(
   
   I'm happy to have another go at fixing this if you can provide something 
more constructive than "it's worse in every way". Having the current code call 
`availableCharsets()` which is specifically documented with "may cause 
time-consuming disk or network I/O operations to occur" in a static initializer 
with no way to opt-out doesn't seem ideal either. AFAICT this is something that 
neither Jetty or Undertow do, so I don't believe it's a problem that _can't_ be 
solved in another way.
   
   I understand that Tomcat has many users that start it only once, and aren't 
really bothered by these kind of optimizations. To them 30ms and not loading an 
extra 50-60 classes isn't really a bit deal. However, I strongly believe that 
there is another class of user that want to run Embedded Tomcat and will care 
deeply about this kind of thing.
   
   If the type of change I'm suggesting is never going to be acceptable, 
perhaps I can change my approach. Would it be better if I tried to make the 
charset lookup code plugabble? That way, the existing code would not need to 
change, but users who do care about this issue could replace the lookup code 
with something else.
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to