infiniteopt / InfiniteOpt.jl

An intuitive modeling interface for infinite-dimensional optimization problems.
https://infiniteopt.github.io/InfiniteOpt.jl/stable
MIT License
254 stars 17 forks source link

[DNMY] Streamline Dispatch Variable Reference Structure #247

Open pulsipher opened 2 years ago

pulsipher commented 2 years ago

This seeks to address #159. It turns out that dispatching on the index types accounts for a fair portion of the performance limitations: https://discourse.julialang.org/t/unexpected-allocations-with-multiple-dispatch/76988. Hence we have a balance between performance of expression creation (aided by GeneralVariableRefs) and performance of querying values (aided by inhomogeneous datatypes). This PR seeks to find a good compromise.

codecov[bot] commented 2 years ago

Codecov Report

Merging #247 (bda963b) into master (c19d5c7) will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #247   +/-   ##
=======================================
  Coverage   99.81%   99.81%           
=======================================
  Files          33       33           
  Lines        7071     7071           
=======================================
  Hits         7058     7058           
  Misses         13       13           
Impacted Files Coverage Δ
src/general_variables.jl 100.00% <100.00%> (ø)

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 c19d5c7...bda963b. Read the comment docs.