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

Shift to using unsorted problem files with Python 3.6 and later #677

Closed
whart222 opened this issue Sep 1, 2018 · 3 comments
Closed

Shift to using unsorted problem files with Python 3.6 and later #677

whart222 opened this issue Sep 1, 2018 · 3 comments

Comments

@whart222
Copy link
Member

whart222 commented Sep 1, 2018

Sorting indices is probably not the biggest performance issue when writing problem files, but it's an obvious one. With PyPy and CPython 3.6 and later, we can assume that dictionary keys are ordered. Hence, we can create deterministic problem files without sorting.

I suggest that we use sorted representations for 3.5 and earlier, and unsorted for 3.6 and later. The only real challenge with this involves testing, and it will likely require two sets of baselines.

@jsiirola
Copy link
Member

jsiirola commented Sep 5, 2018

I strongly believe that Pyomo should produce deterministic output regardless of which (supported) version of Python the user happens to be running in. The rationale is that solvers can produce different outputs when the rows / columns are purmuted, and I do not think that we want to put ourselves in the position of justifying why Pyomo gave a different answer when the Python version changed.

@whart222
Copy link
Member Author

whart222 commented Nov 7, 2019

Given the evolution of Python, I believe that we should reconsider this proposal. I noted that support for 3.4 was deprecated. I think it would be reasonable to have separate writers for modern python versions that exploit the idea proposed here, leaving backward compatible versions for 2.7 and 3.5.

@jsiirola
Copy link
Member

jsiirola commented May 8, 2020

Archived on the master Performance Proposals Issue (#1430). Closing this performance proposal until active development has begun.

@jsiirola jsiirola closed this as completed May 8, 2020
pyomo.core Priorities automation moved this from To do to Done May 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

3 participants