gerrit/gerrit-sshd
Shawn Pearce 242a604b9f Make command line option parsing ~6500% faster
Guice does not like to pass an Injector as part of an @Assisted
invocation of an object. More recent versions of Guice are logging
a warning advising a performance boost of ~6500% is possible if
the class stops accepting Injector in the constructor and instead
uses a more concrete type.

In this case Guice was very correct about the code being slow.
Every option declared required a linear scan through the entire
Injector stack looking for any candidate binding that might match
the OptionHandlerFactory signature. This scan ran on each request,
which is incredibly slow.

Build the map once in the injector and retain as a singleton.

Change-Id: Ib620e7bf1e24241bd373d2cb55c89c3fe3284645
2013-08-05 16:14:10 -07:00
..