How a pure-TypeScript flex layout engine closed the last WASM-Yoga gap
A new flex layout engine called Pilates, built in pure TypeScript, has outperformed the WASM Yoga engine in various scenarios. The improvements are attributed to algorithmic changes that reduced the computational overhead associated with structural mutations. This development suggests that pure TypeScript can compete effectively with native code for specific workloads.
- ▪Pilates is a flex layout engine designed for terminal UIs, built entirely in TypeScript.
- ▪In benchmark tests, Pilates outperformed WASM Yoga in all scenarios, achieving up to 10 times faster performance in some cases.
- ▪The performance gains were achieved through algorithmic optimizations that minimized the computational overhead during updates.
Opening excerpt (first ~120 words) tap to expand
try { if(localStorage) { let currentUser = localStorage.getItem('current_user'); if (currentUser) { currentUser = JSON.parse(currentUser); if (currentUser.id === 3523370) { document.getElementById('article-show-container').classList.add('current-user-is-article-author'); } } } } catch (e) { console.error(e); } Zhijie Wong Posted on May 23 How a pure-TypeScript flex layout engine closed the last WASM-Yoga gap #javascript #performance #showdev #typescript TL;DR I've been building Pilates, a flex layout engine for terminal UIs in pure TypeScript.
…
Excerpt limited to ~120 words for fair-use compliance. The full article is at DEV.to (Top).