fix tree construction for large number of nodes#65
Conversation
|
I change the According to my benchmark, the runtime performance is not decreased, while the compling stage performance is increased significantly. Could you please have a double check? @Jutho |
3 similar comments
Codecov Report
@@ Coverage Diff @@
## master #65 +/- ##
==========================================
- Coverage 79.78% 79.17% -0.62%
==========================================
Files 13 14 +1
Lines 1390 1402 +12
==========================================
+ Hits 1109 1110 +1
- Misses 281 292 +11
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #65 +/- ##
==========================================
- Coverage 79.78% 79.25% -0.53%
==========================================
Files 13 14 +1
Lines 1390 1403 +13
==========================================
+ Hits 1109 1112 +3
- Misses 281 291 +10
Continue to review full report at Codecov.
|
|
Thanks; I'll take a look asap. |
|
The test coverage is decreased, since I wrote some untested printing functions for |
|
Here is a using case for testing julia> using TensorOperations
julia> using Random, BenchmarkTools
julia> Random.seed!(2);
julia> net = ((11, 17), (2, 20), (15, 28, 38), (15, 21, 34), (12, 21, 40), (10, 30), (16, 22, 32),
(13, 22, 38), (12, 20), (2, 27, 33), (5, 16, 37), (3, 26, 40), (6, 24), (14, 24, 36),
(9, 18, 37), (1, 19, 31), (8, 26), (11, 23), (6, 17, 39), (14, 19, 36), (13, 30),
(4, 25, 33), (7, 23, 39), (4, 28), (5, 27, 32), (9, 25, 35), (8, 29), (10, 18, 31),
(7, 29, 35), (1, 3, 34));
julia> unique_tokens = union(net...);
julia> c = Dict(token=>TensorOperations.Power{:χ}(1,1) for token in unique_tokens)
Dict{Int64,TensorOperations.Power{:χ,Int64}} with 40 entries:
33 => χ
18 => χ
1 => χ
32 => χ
2 => χ
40 => χ
16 => χ
11 => χ
⋮ => ⋮
julia> @benchmark TensorOperations.optimaltree(net, c)
BenchmarkTools.Trial:
memory estimate: 227.23 KiB
allocs estimate: 2944
--------------
minimum time: 210.654 μs (0.00% GC)
median time: 217.766 μs (0.00% GC)
mean time: 279.853 μs (14.19% GC)
maximum time: 62.270 ms (99.48% GC)
--------------
samples: 10000
evals/sample: 1 |
|
This looks good; thanks. I'll merge it and tag a new release. |
|
New version 1.1.0 is up! |
fix #63