inspector: use BaseObject for JS binding
Use internal fields instead of the less efficient v8::External
for storing the pointer to the C++ object.
'use strict';
const { Session } = require('inspector');
console.time('a');
for (var i = 0; i < 100000; i++) {
var c = new Session();
c.connect();
c.disconnect();
}
console.timeEnd('a');
becomes faster by 30%, primarily because of the cached ObjectTemplate
I think.
Refs: #13503 (closed)
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
commit message follows commit guidelines
Affected core subsystem(s)
inspector