Skip to content
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

Less time to compute overlap #26

Open
Leticia-maria opened this issue Sep 18, 2023 · 2 comments
Open

Less time to compute overlap #26

Leticia-maria opened this issue Sep 18, 2023 · 2 comments

Comments

@Leticia-maria
Copy link
Member

julia> @time overlap(basis, mol)
  0.000214 seconds (730 allocations: 57.672 KiB)
9×9 Matrix{Float64}:
  1.0           0.417217      4.7553e-22    0.0       -2.24549e-23   0.193855   0.193845   0.193845   0.193849
  0.417217      1.21286      -1.33492e-21   0.0        1.13493e-22   0.859163   0.859146   0.859146   0.859154
  4.7553e-22   -1.33492e-21   1.0           0.0       -4.14649e-43  -0.0939536  0.361208   0.167531  -0.434825
  0.0           0.0           0.0           1.0        0.0           0.41387    0.117069  -0.388952  -0.14202
 -2.24549e-23   1.13493e-22  -4.14649e-43   0.0        1.0          -0.295301   0.350927  -0.296608   0.240999
  0.193855      0.859163     -0.0939536     0.41387   -0.295301      1.0        0.5271     0.527089   0.527123
  0.193845      0.859146      0.361208      0.117069   0.350927      0.5271     1.0        0.527093   0.527093
  0.193845      0.859146      0.167531     -0.388952  -0.296608      0.527089   0.527093   1.0        0.527113
  0.193849      0.859154     -0.434825     -0.14202    0.240999      0.527123   0.527093   0.527113   1.0

julia> using BenchmarkTools

julia> @benchmark overlap(basis, mol)
BenchmarkTools.Trial: 10000 samples with 1 evaluation.
 Range (min  max):  111.042 μs   21.491 ms  ┊ GC (min  max): 0.00%  99.29%
 Time  (median):     120.208 μs               ┊ GC (median):    0.00%
 Time  (mean ± σ):   124.477 μs ± 241.769 μs  ┊ GC (mean ± σ):  2.96% ±  1.70%

               ▁  ▂▄▇█▇█▄▅▃▁
  ▁▁▁▂▁▂▃▃▄▆▇███▆▇███████████▆▅▅▄▄▄▃▃▃▃▂▂▂▂▂▂▂▂▂▂▂▁▁▁▁▁▁▁▁▁▁▁▁▁ ▃
  111 μs           Histogram: frequency by time          138 μs <

 Memory estimate: 57.67 KiB, allocs estimate: 730.
@Leticia-maria
Copy link
Member Author

By adding new doublefactorial() factorial, I have:

julia> @benchmark overlap(basis, mol)
BenchmarkTools.Trial: 10000 samples with 1 evaluation.
 Range (min  max):  103.875 μs   35.961 ms  ┊ GC (min  max): 0.00%  99.57%
 Time  (median):     108.583 μs               ┊ GC (median):    0.00%
 Time  (mean ± σ):   113.875 μs ± 372.782 μs  ┊ GC (mean ± σ):  4.04% ±  1.40%

             ▂▃▆▅▇▇█▇▆▆▅▃
  ▂▄▆▇█▇▅▃▃▄▇█████████████▇▅▆▅▅▅▆▅▄▅▄▄▄▃▃▃▃▃▃▃▃▂▃▃▂▂▂▂▂▂▂▁▂▂▁▁▂ ▄
  104 μs           Histogram: frequency by time          119 μs <

 Memory estimate: 57.67 KiB, allocs estimate: 730.

@Leticia-maria
Copy link
Member Author

old overlap

julia> @benchmark overlap_2(basis, mol)
BenchmarkTools.Trial: 10000 samples with 1 evaluation.
 Range (min  max):  122.417 μs   21.263 ms  ┊ GC (min  max): 0.00%  99.24%
 Time  (median):     128.125 μs               ┊ GC (median):    0.00%
 Time  (mean ± σ):   131.677 μs ± 252.757 μs  ┊ GC (mean ± σ):  2.65% ±  1.40%

            ▁▁   ▁▃▁▄▂▄▃▅▇▅█▅▇▇▅▄▂▃▁
  ▁▁▁▂▃▅▆▇█▇██▆██████████████████████▇▆▅▅▄▄▃▃▃▃▂▂▂▂▂▂▁▂▂▂▁▁▁▁▁▁ ▄
  122 μs           Histogram: frequency by time          137 μs <

 Memory estimate: 57.67 KiB, allocs estimate: 730.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant