Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Trac #31864: Improved input output for backend polymake
From #26368. The interface to polymake seems to have a significant delay. For input, we can avoid it, as polymake accepts nested lists of integers, rationals, floats. For output we can avoid it, as at least for matrices and vectors, we can just parse the representation string. Before: {{{ sage: %time P = polytopes.hypercube(8, backend='polymake') CPU times: user 4.54 s, sys: 260 ms, total: 4.8 s Wall time: 4.81 s sage: %time P = polytopes.hypercube(8, backend='polymake') CPU times: user 3.08 s, sys: 236 ms, total: 3.31 s Wall time: 3.31 s sage: %time P1 = loads(dumps(P)) CPU times: user 805 ms, sys: 48 ms, total: 853 ms Wall time: 853 ms sage: %time P = polytopes.dodecahedron(backend='polymake') CPU times: user 763 ms, sys: 48.2 ms, total: 811 ms Wall time: 811 ms sage: %time P = polytopes.dodecahedron(backend='polymake') CPU times: user 661 ms, sys: 31.7 ms, total: 692 ms Wall time: 692 ms sage: %time P1 = loads(dumps(P)) CPU times: user 62.9 ms, sys: 0 ns, total: 62.9 ms Wall time: 62.6 ms sage: %time P = polytopes.dodecahedron(backend='polymake', exact=False) CPU times: user 408 ms, sys: 19.6 ms, total: 428 ms Wall time: 427 ms }}} After: {{{ sage: %time P = polytopes.hypercube(8, backend='polymake') CPU times: user 1.56 s, sys: 47.4 ms, total: 1.61 s Wall time: 1.62 s sage: %time P = polytopes.hypercube(8, backend='polymake') CPU times: user 69.1 ms, sys: 4.07 ms, total: 73.2 ms Wall time: 72.8 ms sage: %time P1 = loads(dumps(P)) CPU times: user 36.5 ms, sys: 30 µs, total: 36.5 ms Wall time: 36 ms sage: %time P = polytopes.dodecahedron(backend='polymake') CPU times: user 206 ms, sys: 4.1 ms, total: 210 ms Wall time: 209 ms sage: %time P = polytopes.dodecahedron(backend='polymake') CPU times: user 67.9 ms, sys: 0 ns, total: 67.9 ms Wall time: 67.2 ms sage: %time P1 = loads(dumps(P)) CPU times: user 39.2 ms, sys: 3.7 ms, total: 42.9 ms Wall time: 41.8 ms sage: %time P = polytopes.dodecahedron(backend='polymake', exact=False) CPU times: user 78.3 ms, sys: 4.01 ms, total: 82.3 ms Wall time: 81.3 ms }}} URL: https://trac.sagemath.org/31864 Reported by: gh-kliem Ticket author(s): Jonathan Kliem Reviewer(s): Matthias Koeppe
- Loading branch information