3 ms·
Maybe you misunderstand what this article is about, s not about what is the best phone, is about how JS is run in real world where not everyone has super fast
by simion314 7y ago
Maybe you misunderstand what this article is about, s not about what is the best phone, is about how JS is run in real world where not everyone has super fast internet all the time and not everyone has a super fast phone or computer.
So if you are a web developer you get some good advice from this article related to JS not what phone to buy.
- tyingq 7y agoThey are making the point that low end phones are much slower in executing JS than high end phones. Perhaps to remind developers that their experience, on their phone, isn't the experience everyone has. I imagine a lot of developers have recent iPhones. They are, depending on benchmark, up to 3x faster than a flagship Android. Which means the top to bottom chasm is much larger than the snippet suggests. Noting it would strengthen their point.
- BubRoss 7y agoThis article is about the v8 just in time engine, which does not run on an iPhone.
- simion314 7y agoOK, sorry I missundertoo then the iPhone point, my bad, I interpreted it as iPhone is super fast so nobody should forget to mention in any article the iPhone is the fastest phone and Intel i9s are the fastest CPUs. I agree that we the developers should not forget that a lot of people have less powerful hardware. I sometimes hit thus problem at work, say we offer feature X like uploading an image and you can crop that image and apply a filter, how should I add this feature but not have the code even load in the browser if you don't intend to use, is there a pure JS way to do it? AFAIK thee is no good way to load a script at runtime and get an even when the file is loaded and parsed.
- Stratoscope 7y ago> AFAIK [there] is no good way to load a script at runtime and get an [event] when the file is loaded and parsed. You can do this easily by creating a script element dynamically and then either: 1) Listen for the load event on that element, or 2) Have the dynamic script call a function that is already loaded. Here is an example of the first technique: let script = document.createElement( 'script' ); script.addEventListener( 'load', () => { alert( 'three.js is loaded: ' + THREE ); }); script.src = 'https://ajax.googleapis.com/ajax/libs/threejs/r84/three.min.js'; document.head.appendChild( script ); https://jsfiddle.net/geary/szmc1L0h/9/ https://jsfiddle.net/geary/szmc1L0h/9/
- simion314 7y agoThanks, I use this techinque but I had issues with it in the past, I tried a few minutes now to find documentation to confirm if the onload guarantees the script is loaded and finished parsing/interpreting but I can't find it. Your example code works in all the browsers I tested so maybe it was an issue ith th particular script I was testing, there are third party scripts like for embedding an image editor, those could also use this trick to load some dependencies. Great. so I was wrong then, this should work with most third party scripts.
- arvinsim 7y agoYou would be surprised on how many web devs shops don't test for mobile