JuliaAlgebra / DynamicPolynomials.jl

Multivariate polynomials implementation of commutative and non-commutative variables
Other
60 stars 21 forks source link

Avoid unnecessary compilation for similarvariable #13

Closed saschatimme closed 6 years ago

saschatimme commented 6 years ago

Directly dispatch on the similarvariable(f, symb) constructor. Previously the symbol was wrapped in a Val and thus forced compilation for each new symbol.

Before

@time MP.similarvariable(f, gensym(:x0))
0.004129 seconds (289 allocations: 16.340 KiB)
##x0#687

Now

@time MP.similarvariable(f, gensym(:x0))
  0.000017 seconds (14 allocations: 608 bytes)
##x0#688
codecov-io commented 6 years ago

Codecov Report

Merging #13 into master will increase coverage by <.01%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #13      +/-   ##
==========================================
+ Coverage   99.02%   99.02%   +<.01%     
==========================================
  Files          15       15              
  Lines         718      719       +1     
==========================================
+ Hits          711      712       +1     
  Misses          7        7
Impacted Files Coverage Δ
src/DynamicPolynomials.jl 100% <100%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 0e45221...296550d. Read the comment docs.

coveralls commented 6 years ago

Coverage Status

Coverage increased (+0.001%) to 99.018% when pulling 296550ddd632ab1498bb1fddb38f7c5de56418b8 on similarvariable-fix into 0e45221cb0464b5e655a954db54cb592f289cb1d on master.

blegat commented 6 years ago

Good point, thanks !