Replies: 1 comment 12 replies
-
I can look into it tomorrow. It might be that the algorithm which is used by executing (the library which I use internally) is the reason for your problem. You can use --inline-snapshot=disable which disables the snapshot logic ... But this does not help you if you want to fix the snapshots. Can you tell me which commit/file caused this performance problems? |
Beta Was this translation helpful? Give feedback.
12 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm having performance issues with inline-snapshot on Python < 3.11. I added statements to the module using inline-snapshot to print timestamps to a file:
As you can see, on Python 3.8 and 3.9 it took approximately 13 seconds to load the snapshots. On Python 3.10 it took 23 seconds. On Python 3.11 and 3.12 it's almost instantaneous. Subsequent runs give the same results. Not sure why the times differ this much. I'm running
pytest
without any inline-snapshot options. Snapshots are already generated, and tests pass.Note that I have a lot of snapshots keys: 469 (equal to the number of parametrized tests), but not a lot of snapshot files: only 20 or so.
While debugging other things, I think I had noticed that the same code was run twice or more when checking snapshot flags.
Beta Was this translation helpful? Give feedback.
All reactions