Making a new namespace that requires gg4clj, in a newly started Gorilla REPL session (i.e. a newly started JVM):
(time (ns test
(:require [gg4clj.core :as gg4clj])))
takes ~80ms.
If I add [clojure.core.matrix :as matrix] to the :require vector of the gg4clj.core namespace, then the form above takes ~8200ms to evaluate.
Interestingly, if I only require [clojure.core.matrix.protocols :as cmp] then I find it takes ~3500ms, which seems like a very long time given the minimal amount of code in, and referred to, by that namespace.
Is this what you'd expect, or am I doing something dopey?
Reason I'm fussing about the load time is that already the time it takes from wanting to make a plot to getting Gorilla running is uncomfortably long. And I've been thinking recently about how it might be made quicker. So, I'm not too keen on anything that makes it longer! (This would add about 50% to the Gorilla start-up-to-plot time as it stands, which on my machine is about 14s currently).
So, assuming I'm not doing something silly, could we maybe think of any easy ways to reduce the load time in a case like this, where the functions might never be used? That might be a useful thing to do anyway if the c.m dataset API is becoming a standard. [Probably not the right answer here, but in Gorilla REPL, the rendering protocol lives in its own project gorilla-renderable, which has all of about 5 lines of code. This gives a way for other code to add Gorilla renderers without having to depend on Gorilla REPL itself (which has many dependencies).]
Jony