core.matrix icon indicating copy to clipboard operation
core.matrix copied to clipboard

Eliminate PersistentVector's implementations usage from default.clj

Open si14 opened this issue 12 years ago • 1 comments

This is a long-term goal, but I think generally it's better to do this.

For now we reuse PersistentVector's implementations in many places in default.clj, coercing a value to persistent vector, performing an operation and coercing it back. This causes slowness (like in 57146955) and bugs (like in #51). We can avoid this in 2 ways:

  1. use NDArray instead of vectors, as it is presumably faster;
  2. implement defaults using mandatory protocols on arguments.

This options does not contradict with each other, so we can use them both.

si14 avatar Jul 31 '13 20:07 si14

Agree in general, NDArray should be able to replace persistent vector usage. In particular, it actually allows the mutable operations to be implemented properly :-)

There might be a few cases where persistent vectors are more efficient - I think we can use them on a case-by-case basis however.

mikera avatar Jul 31 '13 22:07 mikera