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

Increase performance by changing requests to niquests #166

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

NaruZosa
Copy link

From my end, I saw around a 10x increase in performance by patching pymsteams to use niquests instead of requests.
Niquests is a drop-in replacement for requests, but is actively maintained and runs faster with various improvements.

Also stops shadowing the built-in 'input' function

@rveachkc
Copy link
Owner

I really appreciate the work, but this seems to be a hot swap of niquests vs requests.

One of the reasons I have stayed with requests is that it is a library that can often be included with the os package manager.

I feel like the switch to niquests needs a bit more thought than I'm able to put into this right now.

@NaruZosa
Copy link
Author

That's understandable.

Would you be willing to merge if it was a conditional import?
If Niquests exists, then it's used, otherwise Requests is used.

If not, I'm happy to fork if that would be preferable.

@rveachkc
Copy link
Owner

rveachkc commented Mar 18, 2025 via email

@NaruZosa
Copy link
Author

NaruZosa commented Mar 19, 2025

The dependency tree for both are (taken from uv tree):

niquests v3.13.1 (latest):
├── charset-normalizer v3.4.1
├── urllib3-future v2.12.912
│   ├── h11 v0.14.0
│   ├── jh2 v5.0.8
│   └── qh3 v1.4.2
└── wassima v1.2.2 (certifi alternative that reads certs from OS Trust Store)

requests v2.32.3 (latest):
├── certifi v2024.8.30
├── charset-normalizer v3.4.1
├── idna v3.10
└── urllib3 v2.3.0

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