facebookarchive / prepack

A JavaScript bundle optimizer.
http://prepack.io
Other
14.22k stars 424 forks source link

Deterministic timeout #719

Open motiz88 opened 7 years ago

motiz88 commented 7 years ago

Picking up a theme from #472 and #520 which warrants its own issue: It seems useful to reimplement the RealmOptions.timeout heuristic by counting evaluation operations, over the current nondeterministic approach of measuring wall-clock time.

@NTillmann per your earlier comments I gather you think Environment.prototype.evaluate would the right place to increment and check this proposed counter? If so, seems straightforward enough and I'll give it a go.

NTillmann commented 7 years ago

Kind of. It eventually calls testTimeout. That seems like the right place to install a pure counter-based approach. It would be great if you'd take this on!