-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
specialized arithmetic and in-place functions #35
Comments
probably
Jeffrey Sarnoff
… On Dec 31, 2019, at 5:51 AM, kalmarek ***@***.***> wrote:
by doing promote stuff simple arithmetic allocates a lot:
julia> z = ArbComplex(2)
2.0 + 0im
julia> @time z+1;
0.000023 seconds (11 allocations: 600 bytes)
by exploiting arbs acb_add_si this can be cut to
julia> @time z+1;
0.000010 seconds (5 allocations: 272 bytes)
Mutable arithmetic/ funcions
I'd like to see three-argument arithmetic (along the lines of mul!(out, x, y)). (related: #6)
For all the functions wrapped through @eval (ex. most of elementary.jl) we could easily expose the two argument versions
f!(out, args...) = ... #ccall to arb
function f(args...)
res = ... #allocate the result;
f!(res, args...)
return res
end
Again, this for the purpose of writing more functions and cutting on the allocations/time (especially handy when evaluating the integrand)
will you accept such changes?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
to the first part, those would have to be dispatch specializations .. and to have them foreach of our types and with either ordering of args; we still need the promote versions.
Jeffrey Sarnoff
… On Dec 31, 2019, at 5:51 AM, kalmarek ***@***.***> wrote:
by doing promote stuff simple arithmetic allocates a lot:
julia> z = ArbComplex(2)
2.0 + 0im
julia> @time z+1;
0.000023 seconds (11 allocations: 600 bytes)
by exploiting arbs acb_add_si this can be cut to
julia> @time z+1;
0.000010 seconds (5 allocations: 272 bytes)
Mutable arithmetic/ funcions
I'd like to see three-argument arithmetic (along the lines of mul!(out, x, y)). (related: #6)
For all the functions wrapped through @eval (ex. most of elementary.jl) we could easily expose the two argument versions
f!(out, args...) = ... #ccall to arb
function f(args...)
res = ... #allocate the result;
f!(res, args...)
return res
end
Again, this for the purpose of writing more functions and cutting on the allocations/time (especially handy when evaluating the integrand)
will you accept such changes?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
yes, I by no means intend to replace promote versions; These are supposed to be the fast-track paths for Arb & Int arithmetic |
do you know why |
(just getting back into the game -- will ask) |
and I will accept this as a PR |
|
Yes, now I remember that. Good to have the work around. Please post that itself too. |
by doing
promote
stuff simple arithmetic allocates a lot:by exploiting
arb
sacb_add_si
this can be cut toMutable arithmetic/ funcions
I'd like to see three-argument arithmetic (along the lines of
mul!(out, x, y)
). (related: #6)For all the functions wrapped through
@eval
(ex. most ofelementary.jl
) we could easily expose the two argument versionsAgain, this for the purpose of writing more functions and cutting on the allocations/time (especially handy when evaluating the integrand)
will you accept such changes?
The text was updated successfully, but these errors were encountered: