39
u/NewbornMuse 17h ago
I have programmed a fair amount of python and I have literally never thought "ugh the GC again". Maybe I tried to access a variable that had gone out of scope but that's hardly the GC's fault.
36
25
u/mmhawk576 16h ago
When do I get to post then next “language bad” shitpost….
9
u/-Kerrigan- 14h ago
Next month it's "Java bad" month cause the new students will first encounter it
4
u/Coulomb111 16h ago
Right now!! This sub is meant for that! Or, if you want to go crazy, you can do 'i just spent 4 hours look for the bug and it was literally just a missing semicolon 🤪'
0
u/herbal1st 6h ago
Please accept my most humble and broken apologies. I am filled with deep shame and remorse for my reckless irresponsibility. I now realize that by utilizing a universally relatable joke framework, I have single-handedly ruined your afternoon and compromised the structural integrity of this subreddit. I will immediately begin a period of self-reflection to contemplate the gravity of my carelessness.
/s 😜
6
u/nonlogin 16h ago edited 2h ago
actually, hoping the garbage collector DOES notice every single piece
3
u/herbal1st 6h ago
agreed, thats usually a great strategy. didnt entirely work for me due to a large amount of objects that need to be created in a 3d voxel engine with physics each frame, and avoiding it is more performant than to just rely on the relatively impactful python gc. so i had to start planning ahead and take the gc into account more than i was used to, which kinda felt like there suddenly were a lot of cheese filled mousetraps to avoid all around 😄
10
u/k-mcm 15h ago
Of all the languages that could have been chosen for a performant physics engine, pure Python wasn't the right answer.
2
u/herbal1st 6h ago edited 6h ago
thats certainly true. it was/is a great project to learn why that is the case though 😅
-8
u/Tyfyter2002 14h ago
Wasn't the right language for anything else either, but some people are terrified of punctuation and want to see as little as possible
3
3
u/Fast-Satisfaction482 17h ago
Just null all references that you don't need anymore and you can sneak almost anything past the python GC.
8
106
u/madprgmr 22h ago
What... what is the garbage collector doing? Stalling the simulation? There are techniques you can use to minimize the amount of garbage you generate, and you can also tune the GC or even directly control when it can run.