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

Move to rich comparison of backends. #212

Merged
merged 2 commits into from Sep 29, 2019
Merged

Move to rich comparison of backends. #212

merged 2 commits into from Sep 29, 2019

Conversation

@hameerabbasi
Copy link
Contributor

hameerabbasi commented Sep 28, 2019

Fixes #211.

@hameerabbasi hameerabbasi force-pushed the rich-compare branch from 6d136b6 to 402521d Sep 28, 2019
@hameerabbasi hameerabbasi requested a review from peterbell10 Sep 28, 2019
uarray/_uarray_dispatch.cxx Outdated Show resolved Hide resolved
uarray/_uarray_dispatch.cxx Outdated Show resolved Hide resolved
uarray/_uarray_dispatch.cxx Outdated Show resolved Hide resolved
uarray/_uarray_dispatch.cxx Outdated Show resolved Hide resolved
@hameerabbasi hameerabbasi force-pushed the rich-compare branch from 402521d to 0c9f2e1 Sep 28, 2019
@hameerabbasi hameerabbasi force-pushed the rich-compare branch from 0c9f2e1 to fb33842 Sep 28, 2019
@hameerabbasi hameerabbasi requested a review from peterbell10 Sep 29, 2019
Copy link
Collaborator

peterbell10 left a comment

Looks good, just a couple of nitpicks. It would be good to benchmark this as well.

uarray/_uarray_dispatch.cxx Outdated Show resolved Hide resolved
uarray/_uarray_dispatch.cxx Outdated Show resolved Hide resolved
Co-Authored-By: peterbell10 <peterbell10@live.co.uk>
@hameerabbasi

This comment has been minimized.

Copy link
Contributor Author

hameerabbasi commented Sep 29, 2019

Benchmark

with ua.set_backend(Backend):
    with ua.skip_backend(Backend2):
        %timeit mm()

master: 394 ns ± 6.04 ns
rich-compare: 412 ns ± 5.61 ns

@hameerabbasi hameerabbasi requested a review from peterbell10 Sep 29, 2019
@peterbell10

This comment has been minimized.

Copy link
Collaborator

peterbell10 commented Sep 29, 2019

Is that benchmarking types that don't specialise the comparison operators?

@hameerabbasi

This comment has been minimized.

Copy link
Contributor Author

hameerabbasi commented Sep 29, 2019

Yes, it is. The base case. Although I measured a backend with a simple __eq__ method which uses the is operator for comparison, it doesn't seem to produce a measurable difference.

@hameerabbasi hameerabbasi merged commit 974c5ec into master Sep 29, 2019
2 checks passed
2 checks passed
License Compliance All checks passed.
Details
Quansight-Labs.uarray #20190929.1 succeeded
Details
@peterbell10 peterbell10 deleted the rich-compare branch Sep 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.