-
|
Importing from atproto seems to take a long time. I'm on raspios bullseye, python 3.9. atproto v0.0.55. Yes, this is a low-powered place to run this, but this is extreme slowness. Installed in ~/.local/... to ensure modules can be compiled etc... but this doesn't seem to help % echo "from atproto import Client" | time -p python3 Even going directly to the module doesn't seem to help: % echo "from atproto_client.client.client import Client" | time -p python3 What is it doing for 100+ seconds? How can I speed this up? |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 3 replies
-
|
Wow... it takes up to 1 sec to me, but 100 is insane. All goes from this issue: pydantic/pydantic#9908 Now imagine that we have 400+ pydatic models |
Beta Was this translation helpful? Give feedback.
-
|
OK, I have a hypothesis, will take me some time to test it. I'm guessing that the pydantic_core module (written in Rust, to speed it up) does not have a pre-compiled 32-bit ARM version of the module available. I'm on a Raspberry Pi Zero W. So it may be falling back to a pure python strategy, which is slooooow. I'm going to try to compile pydantic_core myself and see if that helps. |
Beta Was this translation helpful? Give feedback.
-
|
As far as I can tell, my hypothesis is not correct - there is a compiled _pydantic_core module: _pydantic_core.cpython-39-arm-linux-gnueabihf.so and it appears to be loaded correctly. So its just very slow. While I love how quickly I was able to make a bluesky post client in python using this module, maybe its too heavyweight for my needs. I wonder what alternatives I have in python. I guess I can roll my own that just hits the web-service API to post. |
Beta Was this translation helpful? Give feedback.
-
|
pydantic getting serious about import time now! they reported significant improvements in the new alpha version. feel free to test. more info: pydantic/pydantic#9908 (comment) |
Beta Was this translation helpful? Give feedback.
-
|
pydantic team did a very good job in the v2.11 release. the importing time and memory usage have been improved!
i highly recommend updating pydantic; gonna mark this as answered |
Beta Was this translation helpful? Give feedback.
-
|
For my limited use-case, writing a bare-bones poster that hit the API directly was sufficient. Feel free to close the ticket. |
Beta Was this translation helpful? Give feedback.
pydantic team did a very good job in the v2.11 release. the importing time and memory usage have been improved!
i highly recommend updating pydantic; gonna mark this as answered