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

Investigate typing and mypyc #110

Closed
masklinn opened this issue Apr 30, 2022 · 1 comment
Closed

Investigate typing and mypyc #110

masklinn opened this issue Apr 30, 2022 · 1 comment

Comments

@masklinn
Copy link
Contributor

Glyph makes a case for using mypyc in order to build binary wheels / accelerators (?) https://glyph.twistedmatrix.com/2022/04/you-should-compile-your-python-and-heres-why.html

Might be interesting to take a look at it, probably related to or after #93 as a replacement or improved API would be more likely to help with the typing necessary.

However:

  • at the end of the day ua-parser is probably mostly dependent on regex performances (TODO: test), which mypyc likely can't do anything about
  • glyph had to update their bench program to a "low level / optimised implementation" (in Python) to get sensible benefits, ua-parser is all about strings
@masklinn
Copy link
Contributor Author

at the end of the day ua-parser is probably mostly dependent on regex performances (TODO: test), which mypyc likely can't do anything about

While not proven formally, I think the various benching and testing does over the years since this was open are pretty massive hints which don't require bothering with testing:

  • cpython's regex engine is in c, mypyc can't accelerate that, only remove some of the overhead
  • the JITted runtimes absolutely struggle with JIT-compiling the regex workload anyway
  • linear matching is cooked pretty much by definition, Build & evaluate pure python regex filter #235 is almost certainly what we want to head towards rather than this
  • mypyc could make sense on top of Build & evaluate pure python regex filter #235 but that seems somewhat unlikely, still could be worth a shot

@masklinn masklinn closed this as not planned Won't fix, can't repro, duplicate, stale Nov 28, 2024
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

No branches or pull requests

1 participant