My goal is to optimize a synthetic dataset program that imports N-number of .glb files, places them randomly, and fixates a camera on the center of all these objects (so it can render an image of everything); this is done for M-number of desired renderings. Basically creating a collection of 2D pictures with random assortments of my objects.
I have the bulk of this figured out. When I run the program it starts by importing the N-number of .glb files in under a second and renders a picture, but then starts to import them at about 2-3 seconds each and renders a picture, then 8-10 seconds and renders a picture, etc. It doesn't take long before it's importing a single file at 30-60+ second speeds. The render speeds are fine though, they happen fairly quickly; it's just the .glb import speeds. Maybe it is the rendering that is somehow slowing everything down over time; I don't know for sure. Could be anything.
I don't know why this is, or what could be causing it. I couldn't really find anything on the internet about this exact problem. Maybe this is a memory issue and I should be freeing more memory (my RAM usage isn't really increasing though)? Honestly open to (and would appreciate) any suggestions.
Thank you in advance for any help!