Make PrologEnvironment ~6500% faster

Instead of passing the Injector use a singleton Args object that wraps
up all of the singletons needed in prolog predicates.

This offers less flexibility to plugin predicates but gets rid of a
potential Guice problem.  The claimed performance difference may not
exist, but a warning message is removed on startup.

Change-Id: Iceba5d4fb7f75eb867c6a968e5f43912e2213837
This commit is contained in:
Shawn Pearce
2013-08-05 16:40:04 -07:00
parent 242a604b9f
commit 9b24f90849
7 changed files with 89 additions and 21 deletions

View File

@@ -112,7 +112,6 @@ class PRED_current_user_2 extends Predicate.P2 {
}
private static IdentifiedUser.GenericFactory userFactory(Prolog engine) {
PrologEnvironment env = (PrologEnvironment) engine.control;
return env.getInjector().getInstance(IdentifiedUser.GenericFactory.class);
return ((PrologEnvironment) engine.control).getArgs().getUserFactory();
}
}