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

Added slow but thorough matrix benchmarks #65

Merged
merged 1 commit into from
Feb 5, 2020

Conversation

tom-pytel
Copy link
Contributor

These were requested to test the new matrix intermediate simplification in sympy PR #18572.

from sympy import I, S, simplify
from sympy.simplify.simplify import simplify

_TEST_SIMPLIFY = False # test simplify after operation?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the original benchmark since dotprodsimp was optional this was for comparing func(dotprodsimp=True) vs. simplify(func()). I left the code in just in case at some point someone wants to make the same comparison.

def time_A(self): A**4
def time_B(self): B**4
def time_C(self): C**4
def time_D(self): D**4
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe could do

class _TimeMatrixBase:
    def time_A(self): self.func(A)
    def time_B(self): self.func(B)
    def time_C(self): self.func(C)
    def time_D(self): self.func(D)

class TimePow4(_TimeMatrixBase):
    def func(self, M):
        return M**4

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably, but at this point with my potentially limited time I am focusing on the actual matrix code...

@sylee957 sylee957 merged commit 0dbe7a6 into sympy:master Feb 5, 2020
@tom-pytel tom-pytel deleted the matrix_slow branch February 5, 2020 17:29
@moorepants
Copy link
Member

Note that we specifically want to avoid slow benchmarks. I suggest that benchmarks should be under a second here: #8

@tom-pytel
Copy link
Contributor Author

Are the benchmarks in the slow_benchmarks directory run by default? I thought I had read than no, so that is where these reside.

@moorepants
Copy link
Member

I see. I guess those are not run, see #35.

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

Successfully merging this pull request may close these issues.

4 participants