Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Faster capture macro? #19

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Faster capture macro? #19

wants to merge 5 commits into from

Conversation

mcabbott
Copy link
Owner

This @capture replacement is 100x quicker, but fixing one pattern doesn't improve the package startup speed much.

@mcabbott
Copy link
Owner Author

A better test, timing both package loading and time to run the macro. On master, Julia 1.5, best of a few:

EscBook:TensorCast me$ time julia -e '@time (using TensorCast; TensorCast._macro(:(  Z[i,k][j] := fun(A[i,:], B[j])[k] + C[k]^2  )))'
  8.587048 seconds (26.63 M allocations: 1.457 GiB, 4.16% gc time)

real	0m9.496s

vs branch capture:

EscBook:TensorCast me$ time julia -e '@time (using TensorCast; TensorCast._macro(:(  Z[i,k][j] := fun(A[i,:], B[j])[k] + C[k]^2  )))'
  7.843518 seconds (26.06 M allocations: 1.428 GiB, 4.86% gc time)

real	0m8.775s

Also commenting out lazy.jl which loads LazyArrays:

EscBook:TensorCast me$ time julia -e '@time (using TensorCast; TensorCast._macro(:(  Z[i,k][j] := fun(A[i,:], B[j])[k] + C[k]^2  )))'
  3.471463 seconds (7.83 M allocations: 402.050 MiB, 2.25% gc time)

real	0m3.858s

and also static.jl:

EscBook:TensorCast me$ time julia -e '@time (using TensorCast; TensorCast._macro(:(  Z[i,k][j] := fun(A[i,:], B[j])[k] + C[k]^2  )))'
  3.474532 seconds (7.83 M allocations: 402.089 MiB, 2.07% gc time)

real	0m3.854s

Time to bring back Requires, perhaps.

Repository owner deleted a comment from codecov-io Dec 19, 2020
@mcabbott mcabbott force-pushed the master branch 2 times, most recently from 62a9939 to 0b84e3b Compare March 31, 2021 02:30
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant