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

Use a cache on the backend itself to store the context. #210

Merged
merged 1 commit into from Sep 28, 2019
Merged

Conversation

@hameerabbasi
Copy link
Contributor

hameerabbasi commented Sep 27, 2019

Fixes #208

@hameerabbasi

This comment has been minimized.

Copy link
Contributor Author

hameerabbasi commented Sep 27, 2019

This is still WIP, needs tp_traverse on both context managers.

Benchmarks

Case 1

with ua.set_backend(Backend):
    pass

Case 2

with ctx:
    pass

master

Case 1: 409 ns ± 7.46 ns
Case 2: 92.5 ns ± 1.02 ns

ctx-cache

Case 1: 258 ns ± 3.27 ns
Case 2: 88.4 ns ± 1.74 ns

@hameerabbasi hameerabbasi requested a review from peterbell10 Sep 27, 2019
@hameerabbasi hameerabbasi force-pushed the ctx-cache branch from b1d59a1 to c5dc636 Sep 28, 2019
@hameerabbasi

This comment has been minimized.

Copy link
Contributor Author

hameerabbasi commented Sep 28, 2019

This is now ready for review.

Copy link
Collaborator

peterbell10 left a comment

Looks good, just some minor comments.

uarray/_uarray_dispatch.cxx Outdated Show resolved Hide resolved
uarray/_uarray_dispatch.cxx Show resolved Hide resolved
@hameerabbasi hameerabbasi force-pushed the ctx-cache branch from c5dc636 to e3239b8 Sep 28, 2019
@hameerabbasi hameerabbasi requested a review from peterbell10 Sep 28, 2019
@hameerabbasi hameerabbasi merged commit 4fa752b into master Sep 28, 2019
2 checks passed
2 checks passed
License Compliance All checks passed.
Details
Quansight-Labs.uarray #20190928.4 succeeded
Details
@hameerabbasi hameerabbasi deleted the ctx-cache branch Sep 28, 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.