What movie is in your top list despite its absolute shit rating?
JakenVeina @ JakenVeina @lemm.ee Posts 11Comments 607Joined 2 yr. ago
Many of the articles from those platforms are useless noise, but I do still occasionally want to read something that's posted. When that happens, I just F12 and bypass the paywall, or look for the comment that has the article text, from someone else who has already done that.
I'm gonna hazard a guess, just cause I'm curious, that you're coming from JavaScript.
Regardless, the answer's basically the same across all similar languages where this question makes sense. That is, languages that are largely, if not completely, object-oriented, where memory is managed for you.
Bottom line, object allocation is VERY expensive. Generally, objects are allocated on a heap, so the allocation process itself, in its most basic form, involves walking some portion of a linked list to find an available heap block, updating a header or other info block to track that the block is now in use, maybe sub-dividing the block to avoid wasting space, any making any updates that might be necessary to nodes of the linked list that we traversed.
THEN, we have to run similar operations later for de-allocation. And if we're talking about a memory-managed language, well, that means running a garbage collector algorithm, periodically, that needs to somehow inspect blocks that are in use to see if they're still in use, or can be automatically de-allocated. The most common garbage-collector I know of involves tagging all references within other objects, so that the GC can start at the "root" objects and walk the entire tree of references within references, in order to find any that are orphaned, and identify them as collectable.
My bread and butter is C#, so let's look at an actual example.
cs
public class MyMutableObject { public required ulong Id { get; set; } public required string Name { get; set; } } public record MyImmutableObject { public required ulong Id { get; init; } public required string Name { get; init; } }
cs
_immutableInstance = new() { Id = 1, Name = "First" }; _mutableInstance = new() { Id = 1, Name = "First" };
cs
[Benchmark(Baseline = true)] public MyMutableObject MutableEdit() { _mutableInstance.Name = "Second"; return _mutableInstance; } [Benchmark] public MyImmutableObject ImmutableEdit() => _immutableInstance with { Name = "Second" };
Method | Mean | Error | StdDev | Ratio | RatioSD | Gen0 | Allocated | Alloc Ratio |
---|---|---|---|---|---|---|---|---|
MutableEdit | 1.080 ns | 0.0876 ns | 0.1439 ns | 1.02 | 0.19 | - | - | NA |
ImmutableEdit | 8.282 ns | 0.2287 ns | 0.3353 ns | 7.79 | 1.03 | 0.0076 | 32 B | NA |
Even for the most basic edit operation, immutable copying is slower by more than 7 times, and (obviously) allocates more memory, which translates to more cost to be spent on garbage collection later.
Let's scale it up to a slightly-more realistic immutable data structure.
cs
public class MyMutableParentObject { public required ulong Id { get; set; } public required string Name { get; set; } public required MyMutableChildObject Child { get; set; } } public class MyMutableChildObject { public required ulong Id { get; set; } public required string Name { get; set; } public required MyMutableGrandchildObject FirstGrandchild { get; set; } public required MyMutableGrandchildObject SecondGrandchild { get; set; } public required MyMutableGrandchildObject ThirdGrandchild { get; set; } } public class MyMutableGrandchildObject { public required ulong Id { get; set; } public required string Name { get; set; } } public record MyImmutableParentObject { public required ulong Id { get; set; } public required string Name { get; set; } public required MyImmutableChildObject Child { get; set; } } public record MyImmutableChildObject { public required ulong Id { get; set; } public required string Name { get; set; } public required MyImmutableGrandchildObject FirstGrandchild { get; set; } public required MyImmutableGrandchildObject SecondGrandchild { get; set; } public required MyImmutableGrandchildObject ThirdGrandchild { get; set; } } public record MyImmutableGrandchildObject { public required ulong Id { get; set; } public required string Name { get; set; } }
cs
_immutableTree = new() { Id = 1, Name = "Parent", Child = new() { Id = 2, Name = "Child", FirstGrandchild = new() { Id = 3, Name = "First Grandchild" }, SecondGrandchild = new() { Id = 4, Name = "Second Grandchild" }, ThirdGrandchild = new() { Id = 5, Name = "Third Grandchild" }, } }; _mutableTree = new() { Id = 1, Name = "Parent", Child = new() { Id = 2, Name = "Child", FirstGrandchild = new() { Id = 3, Name = "First Grandchild" }, SecondGrandchild = new() { Id = 4, Name = "Second Grandchild" }, ThirdGrandchild = new() { Id = 5, Name = "Third Grandchild" }, } };
cs
[Benchmark(Baseline = true)] public MyMutableParentObject MutableEdit() { _mutableTree.Child.SecondGrandchild.Name = "Second Grandchild Edited"; return _mutableTree; } [Benchmark] public MyImmutableParentObject ImmutableEdit() => _immutableTree with { Child = _immutableTree.Child with { SecondGrandchild = _immutableTree.Child.SecondGrandchild with { Name = "Second Grandchild Edited" } } };
Method | Mean | Error | StdDev | Ratio | RatioSD | Gen0 | Allocated | Alloc Ratio |
---|---|---|---|---|---|---|---|---|
MutableEdit | 1.129 ns | 0.0840 ns | 0.0825 ns | 1.00 | 0.10 | - | - | NA |
ImmutableEdit | 32.685 ns | 0.8503 ns | 2.4534 ns | 29.09 | 2.95 | 0.0306 | 128 B | NA |
Not only is performance worse, but it drops off exponentially, as you scale out the size of your immutable structures.
Now, all this being said, I myself use the immutable object pattern FREQUENTLY, in both C# and JavaScript. There's a lot of problems you encounter in business logic that it solves really well, and it's basically the ideal type of data structure for use in reactive programming, which is extremely effective for building GUIs. In other words, I use immutable objects a ton when I'm building out the business layer of a UI, where data is king. If I were writing code within any of the frameworks I use to BUILD those UIs (.NET, WPF, ReactiveExtensions) you can bet I'd be using immutable objects way more sparingly.
Collusion among all the big players in an industry, in order to exclude other players from succeeding in that industry is indeed anti-competitive, and potentially illegal. There's potential merit here in businesses coordinating with each other on who to blacklist withing the industry, which is why lawyers were willing to take on the case.
Ultimately, it's a question for a judge whether they're doing this for the purpose of suppressing competition, somehow, or whether they're doing it for valid business reasons (like, say, avoiding a company with a history of not paying its bills, or avoiding a company with a history of sabotaging business relationships, or avoiding a company that their own customers actively hate, and would lose them business).
Of course, with the courts the way they are these days, I'm not holding my breath for the obviously-sensible ruling.
Who?
Recall elections are a thing, are they not?
Better him than Musk.
Permanently Deleted
The presentation is different, but the core problem that the FTC is targeting is the same: spending real money to gamble on artificial digital goods.
Pay ya own loans off
No, we want the money that we pay to benefit society, in ways that we couldn't on our own, to be used to benefit society, in ways that we couldn't on our own.
It has indeed been pushed and advertised by TikTok. Or at least, within TikTok.
I'm guessing it got a boost from the Witcher 4 announcement.
A function call of "MyFunction(parameter: GLFW_TRUE)" is more readable than "MyFunction(parameter: 1)". Not by much, mind you, but if given the choice between these two, one is clearly better. It requires no assumptions about what the reader may or may not already know about the system.It communicates intent without any ambiguity.
Was really having trouble wrapping my head around this until I realized that there's a continuous sentence that crosses over the post barrier. I.E. the second post is not the start of a new sentence.
It's rather common Knowledge that NetEase does this exact thing in Narala: Bladepoint, so yeah, not surprising, at all.
I also vaguely remember this being a thing in Pokemon: Unite, not sure if that's also a NetEase game.
Wait, I'm supposed to be doing my home improvements?
A couple dozen? If you count ones that have never started, anyway.
House M.D. Season 7. Love the show, myself, I put it on for a rewatch while working every couple years. The medical stuff ranges from really interesting to utter nonsense, but the character writing is pretty great, throughout.
It's fraud. They publicly claimed, point-blank, to do a certain thing for years, and were instead doing the opposite, in the interest of making more money. The affiliate link thing is only one of several points that they're suing over. The far more egregious one is that they don't actually "scour the internet to find you the best coupons" They will actively hide better coupons that they know about, if marketplaces pay them to, and still tell you in the browser "this is the best coupon."
Permanently Deleted
A Japanese Manga and Anime from the 90s and 00s. It's a story about a kid who gets ahold of a notebook capable of anonymously killing people.
Permanently Deleted
You'll have a tough time fitting the details of each suicide onto one page, for more than a few dozen folks.
I JUST rewatched Gone in Sixty Seconds on a whim, on like Thursday, and spotted that it apparently has a 38% critic rating from Rotten Tomatoes. Fuck that noise, that movie is a materpiece of filmography.