Implemented multiple strategies to speed up start times for TrueTERRAIN for roughly a 19x speed up. TrueTERRAIN is now a very marginal cost to startup times (non-noticeable) whereas before it was very obvious when TrueTERRAIN was enabled at startups.
|
Before |
This PR |
Speed Up |
| Lazy Loading |
~3s |
~1s |
3x |
| Presets |
2s |
0.07s |
~28x |
| Objects/Textures |
2s |
0.015s |
133x |
| Total Startup |
7s |
0.37s |
19x |
I notice little to no difference in startup times between the default scene (ie calling blender --factory-starup in the terminal) and Blender with TrueTERRAIN enabled
Lazy Loading of ImagePreviews
This implements features so as to not load icons or asset previews until needed.
This provides a 3x perceptual speed up of registering TrueTERRAIN on Blender startup or between saves in VSCode in my tests.
True timings is a bit difficult since icons were loaded in threads before. This PR also removes the threading of icons upon start.
Prevent Presets from Caching data
Normally we cache the parent class of presets to easily access the parent class for various settings and code traversal. However, on bulk import of presets this caching (even though it is only once per preset) ends up being very slow.
Speeds went from 2s to 0.07s (28x faster) for this function when loading
Prevent Objects (and Textures) from Caching data
Similar to Presets, passing the parent class into functions needing it speeds things up exceedingly. As well as we were just calling the offending function for no reason (not even storing its result) in one function.
Speeds went from 2s to 0.015s (133x faster) for this function when loading
Implemented multiple strategies to speed up start times for TrueTERRAIN for roughly a 19x speed up. TrueTERRAIN is now a very marginal cost to startup times (non-noticeable) whereas before it was very obvious when TrueTERRAIN was enabled at startups.
I notice little to no difference in startup times between the default scene (ie calling
blender --factory-starupin the terminal) and Blender with TrueTERRAIN enabledLazy Loading of ImagePreviews
This implements features so as to not load icons or asset previews until needed.
This provides a 3x perceptual speed up of registering TrueTERRAIN on Blender startup or between saves in VSCode in my tests.
True timings is a bit difficult since icons were loaded in threads before. This PR also removes the threading of icons upon start.
Prevent Presets from Caching
dataNormally we cache the parent class of presets to easily access the parent class for various settings and code traversal. However, on bulk import of presets this caching (even though it is only once per preset) ends up being very slow.
Speeds went from 2s to 0.07s (28x faster) for this function when loading
Prevent Objects (and Textures) from Caching
dataSimilar to Presets, passing the parent class into functions needing it speeds things up exceedingly. As well as we were just calling the offending function for no reason (not even storing its result) in one function.
Speeds went from 2s to 0.015s (133x faster) for this function when loading