One problem is that you're using an abstract type (Number) for all of the
variable members if your types.

In function declarations, this is okay, because the function is specialized
on the concrete number type. But for types, abstractly typed members are
boxed (stored as pointers), because the exact type is not given in the
definition.

You can get close to the same flexibility of the current code by using
parametric types, which should erase any performance gap.

Cheers,
  Kevin

On Tuesday, October 21, 2014, alexander maznev <[email protected]>
wrote:

> This should be an equivalent, or nearly there, implementation of Elliptic
> Curves mod p as found in the Python ecdsa library.
>
> https://gist.github.com/anonymous/a3799a5a2b0354022eac
>
> Noticeably, regular mod is 10x slower than python?
> Inverse_mod is 7x slower than python.
> Double is 7x slower than python
> Multiply is more than 7X slower than python.
>
>

Reply via email to