mikera/core.matrix — pull request #207 by si14 (2014-10-20 14:43:41+00:00)
Title: Faster NDArray loading

I've tried to find a bottleneck that slows down NDArray loading/compilation, but traces didn't show anything specific, just a lot of work by compiler. This can be reasonable given that after inlining/specialization NDArray is about 150kb of code (per type). The patch does two things:

* specialized versions of NDArray now live in separate namespaces. This helps by allowing to compile only the code that is needed.
* I've added AOT compilation of those namespaces into project.clj, this clearly helps:

```
user=> (require '[clojure.core.matrix :as m])
nil
user=> (time (m/matrix :ndarray-double [[1 2] [3 4]]))
"Elapsed time: 396.013099 msecs"
#
```

If you are aware of downsides of AOTing those, please tell me.

In future code size can be significantly reduced by de-inlining `loop-over` macro and turning it into a type-specialized function. I don't know how big performance impact will be, but there will be some.