4 ms·
It is matter of runtime and not a particular language. Foremost mutable nature of JavaScript makes it usually heavly optimized for performance with low level i
by imhoguy 8y ago
It is matter of runtime and not a particular language.
Foremost mutable nature of JavaScript makes it usually heavly optimized for performance with low level in-place memory changes. These are hard to track and aggregate without some OS/HW level snapshoting support.
Next challenge is recording state of external dependencies: DOM, WebGL, events and other APIs - each would need some change tracking/snapshoting/resuming capabilities.
Recording complete low level app state changes with fine granularity would need lot of fast memory. A dedicated diffing algorithm could make it even usable on developer machine. However I think the current focus of runtime implementors is end-user performance.
Some sort of parial-TTD tradeoff is implemented in JavaScript famework/libraries level: Redux, Vuex, Elm etc.
They efficently track high-level application state changes but on very small scale. The allowed changes are explicitly defined by developer and they are usually grouped into transactions/actions/scopes. Such update granularity together with reactive stateless code allows simple and cheap tracking of changes under framework control. Naturally that falls short when outside effects are involved.