private void registerBindingTypes(final ScriptContext context) {
        if (typeCheckingEnabled) {
            final Map<String, ClassNode> variableTypes = new HashMap<>();
            clearVarTypes();

            // use null for the classtype if the binding value itself is null - not fully sure if that is
            // a sound way to deal with that.  didn't see a class type for null - maybe it should just be
            // unknown and be "Object".  at least null is properly being accounted for now.
            context.getBindings(ScriptContext.GLOBAL_SCOPE).forEach((k, v) ->
                    variableTypes.put(k, null == v ? null : ClassHelper.make(v.getClass())));
            context.getBindings(ScriptContext.ENGINE_SCOPE).forEach((k, v) ->
                    variableTypes.put(k, null == v ? null : ClassHelper.make(v.getClass())));

            COMPILE_OPTIONS.get().put(COMPILE_OPTIONS_VAR_TYPES, variableTypes);
        }
    }
Gets the total number of nanoseconds that the cache spent compiling scripts.
gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngine.java