News for hackers. Stuff that matters.
Re:Faster JavaScript Calls by chmod775 on Monday February 15, 2021 @08:07PM (#26149797)
>"This object will only ever have these properties; it will never have properties created or deleted"

>"This prototype will never be modified at runtime"

You can already give these hints with Object.freeze/Object.seal

Not really hints though, they enforce a certain behavior. Because hints aren't enough. A JS engine may already assume you'll never change the objects, but it still has to support cases where you then do so anyways.

I don't think these alone would enable any substantial speedups, since the performance issues arise where unknown objects are used.

Re:Faster JavaScript Calls by eyelidlessness on Monday February 15, 2021 @09:18PM (#26150198)
> You can already give these hints with Object.freeze/Object.seal

You can but my understanding is the performance tradeoffs aren't great unless you have a workload that especially benefits from it. Those calls are expensive.