Another question to understand. Why do you need 2 ...
# datascience
m
Another question to understand. Why do you need 2 different implementations? Because of memory model on native?
p
There are several reasons for this: • Perfomance - we use OpenBlas, according to benchmarks, the native implementation turned out to be faster than JVM. • Method coverage -
default
module includes native and jvm implementation. And for example, jvm has some methods that aren't in native and vice versa. • Problems with native code - native code is more demanding on the user's device and environment than jvm. • It's easy to experiment by changing the implementation. And users can develope implementation they need themselves, while API will be uniform for everyone.
👍 1
a
Benchmarking is a tricky thing. For example, in native applications it is easy to forget to include the memory cleanup time. I am not sure it makes sense to compare linear operations. For quadratic operations, it is important, but I found out that the algorithm and cache optimization is more important, than nativeness. For example, EJML and ojalog implementation are in some casese significantly faster, than plain algorithms. The problem is that it is not possible to reinvent each and every algorithm, so we need to reuse what already exists.