pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/MagicStack/uvloop/pull/722

b.githubassets.com/assets/pull-requests-be6017ec12798e73.css" /> Optimize `context.run` by making custom C Functions for it by Vizonex · Pull Request #722 · MagicStack/uvloop · GitHub
Skip to content

Optimize context.run by making custom C Functions for it - #722

Open
Vizonex wants to merge 2 commits into
MagicStack:masterfrom
Vizonex:optimize-context-run
Open

Optimize context.run by making custom C Functions for it#722
Vizonex wants to merge 2 commits into
MagicStack:masterfrom
Vizonex:optimize-context-run

Conversation

@Vizonex

@Vizonex Vizonex commented Jan 20, 2026

Copy link
Copy Markdown

I found an optimization recently while brainstorming ways to make contextvars faster.
I have left some details about this in compat.h which is where I put these functions for winloop also

The reason this is faster is because we no longer need to lookup the run method before making any calls to the functions being handled and when we have many handles doing the same things over and over again these optimizations can start to become noticeable (Specifically for TimerHandles and Normal Handles).

If I need to make any changes or remove or edit comments please let me know. I have today and tomorrow off from my parttime job so I should be able to reply rather quickly.

I may not have the ability to run my own test locally since I wrote this from a windows laptop same as with winloop so please let me know if something does not work correctly and I will do my best to fix it.

@Vizonex

Vizonex commented Jan 20, 2026

Copy link
Copy Markdown
Author

Seems that 3.10 macos rounding bug is still jumping in. Do I need to fix that or is this Pull-Request Excusable from that issue?

@tarasko

tarasko commented Jan 23, 2026

Copy link
Copy Markdown
Contributor

This looks very similar to my PR that I did a year ago ;)
https://github.com/MagicStack/uvloop/pull/627/files
still hasn't been merged.

Except that I let Cython to generate code for calling function objects and to handle try-finally block.

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.

2 participants

pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy