webidl2js icon indicating copy to clipboard operation
webidl2js copied to clipboard

Wrapper lazy instantiation

Open pmdartus opened this issue 5 years ago • 1 comments

When playing around with https://github.com/jsdom/webidl2js/pull/155 I came to the realization that for each created impl, webidl2js eagerly creates the associated wrapper. However, 99% of the jsdom code operates on the impls not the wrappers, window.js is the only exception. Those wrappers are only needed when userland code manipulates the DOM APIs.

I am wondering if it could be possible to make all the wrapper instantiation lazy to reduce the overall jsdom memory footprint.

pmdartus avatar Jan 18 '20 09:01 pmdartus

That would probably also make #155 not cause a 3× slowdown on V8.

ExE-Boss avatar Jan 18 '20 18:01 ExE-Boss