Math.minmax

kai zhu kaizhu256 at gmail.com
Sat Oct 7 04:32:18 UTC 2017


oh fyi, here are 2016 screenshots of the crash in chrome i took when reporting it (showing it works fine in canary, but broken in stable)

-kai








> On Oct 7, 2017, at 11:59 AM, kai zhu <kaizhu256 at gmail.com> wrote:
> 
> on tc39 criterias, this applies more to language-spec than library changes, but i think another criteria that can showstop stage 2-3 proposals is finding out whether a new syntax creates subtle engine de-optimizations that breaks the web.
> 
> around mid-2016, i recall sites like github.com <http://github.com/> and npmjs.com <http://npmjs.com/> using readme.md as their landing-page would frequently freeze and crash in chrome. each time, i basically could not use chrome to visit these sites for a week or so until chrome auto-updated. this issue may or may not be related to javascript, but it hardened my conservative-perspective on proposals that can negatively impact the web.
> 
>> On Oct 3, 2017, at 1:38 AM, Ben Newman <benjamin at cs.stanford.edu <mailto:benjamin at cs.stanford.edu>> wrote:
>> 
>> Taking a step back from the details of this proposal, I have some thoughts about why it seems to be struggling to find support.
>> 
>> In no particular order, I would say this proposal
>> relies on microbenchmarks, which can be misleading <https://tomdale.net/2017/07/adventures-in-microbenchmarking/>
>> disregards Amdahl's Law <https://en.wikipedia.org/wiki/Amdahl%27s_law>, by pretending that real-world JS CPU usage is commonly/ever dominated by min/max computations
>> replaces two O(n) loops with another O(n) loop that does slightly more work on each iteration, resulting in no complexity improvement, and a fairly modest (< 2x) constant factor improvement
>> doesn't seem to provide usability/learnability improvements for any particular group of JS developers (for example, novice programmers)
>> doesn't seem to prevent any common bugs in JS code
>> As a member of TC39, I regret that we have not provided a clearer set of criteria for what it takes to get a new function into the standard library. While I can't speak for the committee as a whole, my suspicion is that this proposal is unlikely to meet that standard. It's a fine idea, but so are many other functions that you can implement in a normal (non-standard) library.
>> 
>> I would also challenge the committee to think about (or link to!) any concrete written criteria that someone with an idea for a proposal could use to assess its chances of acceptance. Imagine how much time we could save!
>> 
>> Ben
>> 
>> On Mon, Oct 2, 2017 at 12:12 PM Xavier Stouder <xavier at stouder.io <mailto:xavier at stouder.io>> wrote:
>> JDecker: Just added your solution on the benchmark, it beats every
>> others solution and it's a elegant solution.
>> 
>> Kai Zhu: We can't see the screenshot. But please take in consideration
>> that it's been a long time that ECMAScript isn't only used in webapp,
>> and that some of applications using it can eat more than a million
>> numbers.
>> _______________________________________________
>> es-discuss mailing list
>> es-discuss at mozilla.org <mailto:es-discuss at mozilla.org>
>> https://mail.mozilla.org/listinfo/es-discuss <https://mail.mozilla.org/listinfo/es-discuss>
>> _______________________________________________
>> es-discuss mailing list
>> es-discuss at mozilla.org <mailto:es-discuss at mozilla.org>
>> https://mail.mozilla.org/listinfo/es-discuss
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20171007/b2201e5e/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PastedGraphic-1.tiff
Type: image/tiff
Size: 761970 bytes
Desc: not available
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20171007/b2201e5e/attachment-0004.tiff>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PastedGraphic-5.tiff
Type: image/tiff
Size: 544030 bytes
Desc: not available
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20171007/b2201e5e/attachment-0005.tiff>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PastedGraphic-2.tiff
Type: image/tiff
Size: 493808 bytes
Desc: not available
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20171007/b2201e5e/attachment-0006.tiff>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PastedGraphic-3.tiff
Type: image/tiff
Size: 406328 bytes
Desc: not available
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20171007/b2201e5e/attachment-0007.tiff>


More information about the es-discuss mailing list