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:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user