Articles

(Mar 30) #cpp #optimization #v8 Save to Pocket

Six years ago, Chrome switched from being a 32-bit to a 64-bit process. This means that pointers were now 8 bytes (64 bits) long, double the length that they previously were. Such a substantial change doesn't go unnoticed. In this extensive article, authors Igor Sheludko and Santiago Aboy Solanes discuss the impact of this change, and how it's actively being solved through pointer compression. They layout the evolution of optimization that led to V8 having the performance of a 64-bit process while consuming the memory of a 32-bit one.

(Mar 31) #swift Save to Pocket

ObjectIdentifier is a feature in Swift that is essentially "just a wrapper for an object's memory address". It has some handy uses though when it comes to using metatypes as a key for a dictionary, as author of this article Bruno Rocha points out. Bruno does a deep dive into this feature, answering the questions what is it, how it works internally, how it can be used to increase performance, and where you can learn more about it.

(Mar 31) #truffleruby #optimization Save to Pocket

In Ruby, the ||= operator is meant to assign a value on the right side to the variable on the left side, if the variable on the left side doesn't already have a value assigned. Idiomatically, it's not really used for this purpose, as Carol Chen explains in this article. Since the "common use case of the operator isn't so much 'assign if' and more 'assign once'", Carol has written an optimization for TruffleRuby that takes this into account, and demonstrates some of the benchmark results.

And that's it for today! Discuss this issue at our subreddit r/morningcupofcoding.

Did you like what you read? Let us know by clicking one of the links below.

Liked - Disliked

I hope you enjoyed reading the latest issue of Morning Cup of Coding. If you did, consider supporting us by becoming a patron (Patreon) for perks like ad-free issues, or via a one-time donation via PayPal.

Interested in sponsoring our newsletter? Click here to send us an email.

Cheers,

Pek