sympy / sympy_benchmarks

Some benchmarks of SymPy
14 stars 32 forks source link

Added Polygon benchmark #66

Closed OmarWagih1 closed 4 years ago

OmarWagih1 commented 4 years ago

Continuing on the effort in benchmarking sympy, i started by benchmarking the polygon class in the geometry folder.

The benchmarks currently work with asv and i'm looking to benchmark other classes in the geometry module once i get some feedback on this benchmark.

Release Notes

sylee957 commented 4 years ago

I think that some benchmarks are failing. Did you confirm that you can run the example across some previous versions?

OmarWagih1 commented 4 years ago

I think that some benchmarks are failing. Did you confirm that you can run the example across some previous versions?

Hello, yes some of them are failing for versions 1.0 - 1.4, but that is because these functions were implemented in version 1.5, starting version 1.5 and up, they should work fine.

I assumed even if we had little history of how they benchmark we would want to benchmark them for the future and start somewhere.

sylee957 commented 4 years ago

We should look for a way to automatically disable some benchmarks if they are not supported in old versions

OmarWagih1 commented 4 years ago

We should look for a way to automatically disable some benchmarks if they are not supported in old versions

The only way i could find in asv to skip tests is to raise a NotImplementedError in the setup class, this is skipped in functions intentionally by ASV (Could refer to this issue https://github.com/airspeed-velocity/asv/issues/638),

so the current way to skip benchmarks is by making them all in separate classes, not ideal coding format as i assume, but the only solution I could find. Benchmarks are now skipped (output is n/a) if the function is not supported.

sylee957 commented 4 years ago

What about grouping the benchmarks into things that were working persistently across all versions, and things that only works after 1.5?

And I think that you should better use sympy.version than catching the attribute errors, because someone can introduce some bugs for the methods later.

OmarWagih1 commented 4 years ago

What about grouping the benchmarks into things that were working persistently across all versions, and things that only works after 1.5?

And I think that you should better use sympy.version than catching the attribute errors, because someone can introduce some bugs for the methods later.

They don't all appear in version 1.5, of the ones that are not in 1.0, there is one that is developed in 1.3 and others that are developed in 1.5, i grouped the attributes together under an umbrella class and the other functions were left as is, I think it would be more descriptive this way.

And yes, that is a very good note, thank you! i used the sympy.version to compare.