import {WatchedProxyFacade} from "./watchedProxyFacade"; import {performance_withoutChangeEvents} from "./origChangeTracking"; console.log("Start") const startTime = new Date().getTime(); // Comment / uncomment the test to run: manyReadsOnAProxiedObject() function manyReadsOnAProxiedObject() { const facade = new WatchedProxyFacade(); facade.onAfterRead((read) => { read.onAfterChange(() => { }, true) }); const myObj = new class MyClass{ _myProp = "123" get myProperty() { return this._myProp; } } const proxy = facade.getProxyFor(myObj); for (let i = 0; i < 100000; i++) { performance_withoutChangeEvents(() => { proxy.myProperty; }) } } console.log(`Finished in ${new Date().getTime() - startTime}ms`)