Re:You Should Compile Your Python and Here’s Why
by BiteCode_dev on Friday April 29, 2022 @02:24PM
(#31208919)
Anthony Sottile has a good bit on it: https://www.youtube.com/watch?v=tFrh9hKMS6Y
TL;DR: Path() initialization is very heavy compared to simple strings, and subsequent path operations produce new Path() objects every time.
The video then illustrates the point with a patch to the black formatter cache yielding a 40X speedup.
Do you have any numbers to back this up? Why would Pathlib be slow?