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

show on Polyhedron takes more than 3 minutes to compile with more than 2 GB of allocation #128

Closed
blegat opened this issue Oct 9, 2018 · 3 comments

Comments

@blegat
Copy link
Member

blegat commented Oct 9, 2018

On Julia v1.0.1:

$ julia
julia> using Polyhedra

julia> vshort = vrep([[i, -i] for i in 1:3])
V-representation Polyhedra.PointsHull{Int64,Array{Int64,1},Int64}:
3-element iterator of Array{Int64,1}:
 [1, -1]
 [2, -2]
 [3, -3]

julia> v = vshort + Ray([1, 0])
V-representation Polyhedra.Hull{Int64,Array{Int64,1},Int64}:
3-element iterator of Array{Int64,1}:
 [1, -1]
 [2, -2]
 [3, -3],
1-element iterator of Ray{Int64,Array{Int64,1}}:
 Ray([1, 0])

julia> p = polyhedron(v);

julia> @time show(p)
convexhull([1//1, -1//1], [2//1, -2//1], [3//1, -3//1]) + convexhull(Ray(Rational{BigInt}[1//1, 0//1]))
211.705716 seconds (2.43 G allocations: 125.650 GiB, 10.17% gc time)
false

julia> @time show(p)
convexhull([1//1, -1//1], [2//1, -2//1], [3//1, -3//1]) + convexhull(Ray(Rational{BigInt}[1//1, 0//1]))
0.000262 seconds (189 allocations: 6.469 KiB)
@blegat blegat added this to the 0.4.0 milestone Oct 9, 2018
@blegat
Copy link
Member Author

blegat commented Oct 9, 2018

Timing of tests
With Julia v0.7:

> julia
  0.720557 seconds (942.53 k allocations: 45.184 MiB, 3.67% gc time)
 42.399550 seconds (2.07 M allocations: 105.244 MiB, 0.22% gc time)
Test Summary: | Pass  Total
Element       |   31     31
 12.453737 seconds (18.74 M allocations: 901.799 MiB, 5.76% gc time)
Test Summary: | Pass  Total
Comparison    |    2      2
  0.069886 seconds (72.50 k allocations: 3.458 MiB)
┌ Warning: Not solved to optimality, status: Unbounded
└ @ JuMP ~/.julia/dev/JuMP/src/solvers.jl:212
┌ Warning: Not solved to optimality, status: Infeasible
└ @ JuMP ~/.julia/dev/JuMP/src/solvers.jl:212
┌ Warning: Element type Int64 does not have an infinite value. Note that this may artifically introduce ranged (two-sided) constraints. To avoid this, consider casting the problem data to Float64.
└ @ MathProgBase.HighLevelInterface ~/.julia/packages/MathProgBase/e5IOK/src/HighLevelInterface/HighLevelInterface.jl:9
┌ Warning: Element type Int64 does not have an infinite value. Note that this may artifically introduce ranged (two-sided) constraints. To avoid this, consider casting the problem data to Float64.
└ @ MathProgBase.HighLevelInterface ~/.julia/packages/MathProgBase/e5IOK/src/HighLevelInterface/HighLevelInterface.jl:9
Test Summary:        | Pass  Total
Representation tests |  687    687
162.796165 seconds (419.91 M allocations: 21.916 GiB, 7.74% gc time)
Test Summary: | Pass  Total
Dual Type     |    5      5
Test Summary:         | Pass  Total
Unimplemented methods |    9      9
Test Summary:                                        | Pass  Total
Polyhedra.DefaultPolyhedron constructor with nothing |    6      6
 17.914792 seconds (50.92 M allocations: 2.620 GiB, 11.07% gc time)
Test Summary:      | Pass  Total
Redundancy removal |    5      5
Test Summary:     | Pass  Total
Duplicate removal |   10     10
  7.106755 seconds (17.15 M allocations: 934.259 MiB, 8.25% gc time)
Test Summary:      | Pass  Total
Double Description |   43     43
 54.696648 seconds (138.92 M allocations: 7.293 GiB, 9.75% gc time)
Test Summary:  | Pass  Total
Interval tests |  246    246
 23.428109 seconds (55.57 M allocations: 2.910 GiB, 9.77% gc time)
Test Summary:         | Pass  Total
PolyhedraToLPQPBridge |    9      9
  4.994856 seconds (7.07 M allocations: 341.081 MiB, 7.03% gc time)
Test Summary: | Pass  Total
Default       |   14     14
  0.204540 seconds (121.28 k allocations: 6.157 MiB, 9.82% gc time)
Test Summary: | Pass  Total
Show          |   23     23
371.137296 seconds (1.35 G allocations: 70.100 GiB, 10.96% gc time)
  8.974451 seconds (4.62 M allocations: 229.618 MiB, 2.78% gc time)
Test Summary:                                | Pass  Total
Polyhedra tests in floating point arithmetic |  511    511
739.231174 seconds (2.57 G allocations: 133.268 GiB, 11.94% gc time)
Test Summary:                       | Pass  Total
Polyhedra tests in exact arithmetic |  511    511
744.256898 seconds (2.54 G allocations: 131.469 GiB, 12.98% gc time)

With Julia v1.0:

$ jr
  0.405315 seconds (856.78 k allocations: 41.592 MiB, 2.79% gc time)
  0.945913 seconds (1.76 M allocations: 91.145 MiB, 2.31% gc time)
Test Summary: | Pass  Total
Element       |   31     31
  6.897203 seconds (17.04 M allocations: 835.446 MiB, 3.87% gc time)
Test Summary: | Pass  Total
Comparison    |    2      2
  0.044628 seconds (65.91 k allocations: 3.230 MiB)
┌ Warning: Not solved to optimality, status: Unbounded
└ @ JuMP ~/.julia/dev/JuMP/src/solvers.jl:212
┌ Warning: Not solved to optimality, status: Infeasible
└ @ JuMP ~/.julia/dev/JuMP/src/solvers.jl:212
┌ Warning: Element type Int64 does not have an infinite value. Note that this may artifically introduce ranged (two-sided) constraints. To avoid this, consider casting the problem data to Float64.
└ @ MathProgBase.HighLevelInterface ~/.julia/packages/MathProgBase/e5IOK/src/HighLevelInterface/HighLevelInterface.jl:9
┌ Warning: Element type Int64 does not have an infinite value. Note that this may artifically introduce ranged (two-sided) constraints. To avoid this, consider casting the problem data to Float64.
└ @ MathProgBase.HighLevelInterface ~/.julia/packages/MathProgBase/e5IOK/src/HighLevelInterface/HighLevelInterface.jl:9
Test Summary:        | Pass  Total
Representation tests |  687    687
 70.517496 seconds (411.80 M allocations: 21.615 GiB, 8.61% gc time)
Test Summary: | Pass  Total
Dual Type     |    5      5
Test Summary:         | Pass  Total
Unimplemented methods |    9      9
Test Summary:                                        | Pass  Total
Polyhedra.DefaultPolyhedron constructor with nothing |    6      6
  7.158264 seconds (49.93 M allocations: 2.584 GiB, 11.30% gc time)
Test Summary:      | Pass  Total
Redundancy removal |    5      5
Test Summary:     | Pass  Total
Duplicate removal |   10     10
  3.141177 seconds (16.80 M allocations: 921.197 MiB, 10.25% gc time)
Test Summary:      | Pass  Total
Double Description |   43     43
 22.973413 seconds (136.53 M allocations: 7.205 GiB, 11.23% gc time)
Test Summary:  | Pass  Total
Interval tests |  246    246
 10.857566 seconds (54.51 M allocations: 2.868 GiB, 10.69% gc time)
Test Summary:         | Pass  Total
PolyhedraToLPQPBridge |    9      9
  2.624053 seconds (6.42 M allocations: 315.662 MiB, 6.61% gc time)
Test Summary: | Pass  Total
Default       |   14     14
  0.116294 seconds (109.97 k allocations: 5.727 MiB)
Test Summary: | Pass  Total
Show          |   23     23
134.124206 seconds (1.35 G allocations: 70.059 GiB, 16.39% gc time)
  1.740677 seconds (4.18 M allocations: 212.181 MiB, 6.14% gc time)
Test Summary:                                | Pass  Total
Polyhedra tests in floating point arithmetic |  511    511
279.908033 seconds (2.57 G allocations: 133.073 GiB, 18.06% gc time)
Test Summary:                       | Pass  Total
Polyhedra tests in exact arithmetic |  511    511
283.359234 seconds (2.54 G allocations: 131.301 GiB, 18.72% gc time)

@blegat blegat removed this from the 0.4.0 milestone Oct 11, 2018
@blegat
Copy link
Member Author

blegat commented Nov 29, 2018

Looks like it is fixed in JuliaLang/julia#30010

@blegat
Copy link
Member Author

blegat commented Dec 20, 2018

Closing as Julia v1.0.3 was released 🎉

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

No branches or pull requests

1 participant