absorb.md

Programming

Amjad Masad8Tobi Lütke6Guillermo Rauch1
No compiled wiki article for this topic yet. Raw entries below are the source material — a wiki article can be generated on demand from /admin/triggers.

Node.js Manual GC Effectively Reclaims Massive Heap Allocations of Object Arrays

Node.js script allocates 20 million empty objects in a loop, spiking heapUsed from ~3.5 MB to ~782 MB. Explicit gc() call then reclaims nearly all allocated memory, dropping heapUsed back to ~3.4 MB consistently across repeated cycles. Demonstrates V8's garbage collector handles large, short-lived o

Ruby Keyword Arguments Are 9x Slower Than Positional Arguments, Hash Arguments 4x Slower

Benchmark by Shopify CTO Tobi Lütke compares Ruby method calls with positional arguments, keyword arguments, and hash arguments over 1 million iterations. Positional arguments complete in 0.176s real time, hash arguments in 0.795s, and keyword arguments in 1.677s. Keyword syntax imposes the highest

Racket Implementation of Conway's Game of Life with 2htdp Universe Animation

This Racket code implements Conway's Game of Life using 2htdp libraries for a grid-based cellular automaton. It defines cell and board structures, neighbor counting via bounded iteration, and applies standard survival/birth rules: live cells survive with 2-3 neighbors, die otherwise; dead cells birt

JavaScript for-loop closures capture shared variable reference, not snapshot values

In JavaScript, functions created inside a for loop share the same lexical scope for the loop variable `c`, so all closures reference its final value rather than individual iterations. This behavior occurs because JavaScript has function-level scope, not block-level, causing unexpected outputs when i