Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This workload seems IO bound so python 3.11 shouldn't add too many speedups here, it adds mostly cpu-bound improvements. Surprised you are getting speedsup - any idea which parts?


I haven't done any low level profiling. I ran my test suite 5 times with 3.10 and then I did the same after updating to 3.11. It was an extremely informal test but 3.10 consistently took about 25 seconds where as 3.11 was finishing in 23.

It is I/O bound but it's all localized. Those URL endpoints aren't making external API calls. For tests, Postgres is set to use Session.begin_nested with SQLAlchemy which takes advantage of Postgres' ability to use SQL SAVEPOINTs[0]. The gory details are above my paygrade (I found it while Googling), but the end result is it makes Postgres able to be really really fast when accessing your DB in tests. I don't think it really writes to disk but it makes your app think it did and you get the "true" outcome of running the SQL (ids get created, all of your SQL works as expected, etc.). It's not a mock.

[0]: https://docs.sqlalchemy.org/en/20/orm/session_transaction.ht...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: