Rendered at 15:17:47 GMT+0000 (Coordinated Universal Time) with Cloudflare Workers.
220hertz 40 minutes ago [-]
I used to write a lot of Javascript-like Extendscript scripts back when I was using InDesign a lot. The DOM's global object $ had a method to directly invoke the garbage collector. It made a difference certainly, but it was difficult to tell to what extent because InDesign itself gradually leaks memory and becomes more bloated the longer you use it in a single session.
thomashabets2 34 minutes ago [-]
> In Rust you pay for it by arranging your program in a way the compiler can verify.
I disagree with this. The sentence implies that this work is done in order to make the compiler happy, where my experience is that it forces the programmer to actually get it right.
I had an "aha moment" when I was frustrated at failing to express my intent to the compiler, and suddenly realised that the reason I couldn't "just say the magic words" was that my object ownership design was inherently flawed. I had to make large changes not to make the compiler happy, but to actually have a coherent design.
So no, it's not about what "the compiler can verify". That's like saying "my lawyer won't let me do this". No, your lawyer is your employee, not your boss. They're just saying that if you do this, then you may go to prison. It's not the same thing.
("unsafe" is the Rust way to go "thank you, legal department, but I'm making a business decision to take this risk. Your concern has been noted")
ron_k 10 minutes ago [-]
I understand what you’re saying, but I read that phrase in a different way.
Let’s say you have two ways of doing the same thing: both work, both are legit and neither introduce GC bugs. The only difference between the two is that one can be verified by the compiler while the other can’t, so you are stuck with solution no. 1 although both would work.
To phrase it differently: the code that gets verified by the compiler is safe, but is all safe code verifiable by the compiler?
I’m not implying that’s the case, but that’s what I feel the author is saying.
pohl 5 minutes ago [-]
> both work
Usually it’s a matter where one works and the other “works”.
shivanshuag 4 days ago [-]
Agreed, for most real world softwares, the cost of GC is irrelevant. But there are still some programs like databases or game engines where the cost can start adding up. That's when you measure and optimize.
pjmlp 1 hours ago [-]
Yet the three major game engines Unreal, Unity and Godot all have a GC on their infrastructure, and Capcom is quite happy with their .NET fork on RE Engine.
Also every single graphics application that uses Metal or DirectX, relies on reference counting as GC algorithm.
slopinthebag 25 minutes ago [-]
I’m sure those three engines have had no issues with performance whatsoever right?
Oh shit…
jmull 10 minutes ago [-]
Game developers are always trying to push the boundaries. The only game engines without performance issues are ones hardly being used.
pjmlp 17 minutes ago [-]
I am sure that many of the issues were a skills issue as well.
izacus 20 minutes ago [-]
Do you have any source taking about GC caused performance issues in those engines?
marcosdumay 44 minutes ago [-]
> That's when you measure and optimize.
How do you "optimize" the GC away after you wrote your entire database server in a language that uses it?
ApolloFortyNine 28 minutes ago [-]
It's incredibly in common in game development, C# has a lot of features you can take advantage for this.
But the most naive example any language supports is simple object pooling.
GC languages typically have features of the language and/or standard library that make GC the default, not the only option.
miladyincontrol 4 days ago [-]
What does GC cost?
For Caddy with an incredibly synthetic http only benchmark it costs about 2ms of latency and somewhat less throughput.
Worth it in an incredibly artificial benchmark? Perhaps. However when it comes to real world usage the cost is a significantly smaller piece of the pie.
pclowes 46 minutes ago [-]
This is one of the best high-level survey explanations of GC I have seen, nice work.
amazingamazing 23 minutes ago [-]
I rarely see a real use case bottle necked on garbage collection.
EGreg 30 minutes ago [-]
There is no need for garbage collection if you don’t form circular references. Just have a canonical direction and always keep weak references the other way.
thomashabets2 20 minutes ago [-]
Reference counting is a different model. Many papers have explored the differences and similarities, and your comment leaves so much out that it cannot even be said to be true or false.
I'd say GC is always the fastest to free objects within the main code path. Literally zero instructions.
I disagree with this. The sentence implies that this work is done in order to make the compiler happy, where my experience is that it forces the programmer to actually get it right.
I had an "aha moment" when I was frustrated at failing to express my intent to the compiler, and suddenly realised that the reason I couldn't "just say the magic words" was that my object ownership design was inherently flawed. I had to make large changes not to make the compiler happy, but to actually have a coherent design.
So no, it's not about what "the compiler can verify". That's like saying "my lawyer won't let me do this". No, your lawyer is your employee, not your boss. They're just saying that if you do this, then you may go to prison. It's not the same thing.
("unsafe" is the Rust way to go "thank you, legal department, but I'm making a business decision to take this risk. Your concern has been noted")
Let’s say you have two ways of doing the same thing: both work, both are legit and neither introduce GC bugs. The only difference between the two is that one can be verified by the compiler while the other can’t, so you are stuck with solution no. 1 although both would work.
To phrase it differently: the code that gets verified by the compiler is safe, but is all safe code verifiable by the compiler?
I’m not implying that’s the case, but that’s what I feel the author is saying.
Usually it’s a matter where one works and the other “works”.
Also every single graphics application that uses Metal or DirectX, relies on reference counting as GC algorithm.
Oh shit…
How do you "optimize" the GC away after you wrote your entire database server in a language that uses it?
But the most naive example any language supports is simple object pooling.
Then more fancy, zero allocations tasks in C# https://github.com/cysharp/unitask
I'd say GC is always the fastest to free objects within the main code path. Literally zero instructions.