Small threadsafevariable change == decent request time speedup

30 views
Skip to first unread message

laundmo

unread,
Aug 8, 2025, 7:52:22 AMAug 8
to py4web
Hi Massimo (mainly)

3 weeks ago I submitted a PR for the threadsafevariable utility used in py4web which speeds up requests by quite a lot due to a faster Threadsafevariable.restore() method.

You didn't seem to have noticed this, so I wanted to ping you here.
It's a pretty simple change - storing in a dict variable instead of the objects __dict__ and copying the whole restore image - but it results in cutting the time per request it takes from 7% per request to 0.23% in my tests.

Cheers

Massimo

unread,
Aug 24, 2025, 4:50:17 PM (14 days ago) Aug 24
to py4web
Sorry overlooked this. Been travelling a lot. Merged now and upgrading py4web. Thanks for the help
Reply all
Reply to author
Forward
0 new messages