I was under the impression that V8 and the like are so optimized that this would give marginal gains. Would love to be wrong though. Do you have any performance benchmarks?
A good resource to have info about this initiative: https://www.youtube.com/watch?v=xbZzahWakGs
Prepack helps make JavaScript code more efficient
121–130 of 233 posts
Re: Prepack helps make JavaScript code more efficient
#122I hate to bring this up whenever I see a Facebook project, but it still warrants saying: the patents clause in this project, like in others including React, is too broad. I really wish they made a "version 3" that limited the scope of the revocation to patents pertaining to the software in question, e.g. Prepack, React, rather than a blanket statement that covers any patent assertion against Facebook. While I suppose…
I never imagined, then (being late 90s) that a brochureware dot com might require liability boxing legally, but I never imagined whole libraries like React being adopted so wholesale, so seemingly blindly (if not blindly, why has nobody posted the outcome of due diligence? A blog topic I'd like the attention from.) and so trivially as, yes, our brochureware site just could get used against us. Our early clients expressed concern, first: we had to pass their IP hygiene checks. We adopted those, right away. Such stringencies are why many entities I've worked with, have no or empty websites, but old old registration dates on their dot coms...
* edit, missing dependant clause I guess was strongly implied, but it's about when we first saw frivolous, vexatious patent suits aiming at the front doors of random web presences condition there might be money and weak legal... I mistakenly imagined that to be spurious, not it would develop into a psedo- legitimate"industry".
A moral thought: Maybe if we sold fewer reinvented wheels, there might be less temptation for parasitic behaviour to organize itself, like patent trolling has done? I can certainly plead the fifth to wheel reinvention, most days I write code ... (edit last) my meaning behind this is that I frequently have found highly objectionable behaviour being justified by the calling out of perceived comparable poor behaviour. Now I don't go sp far to condemn e.g. the js library crowd or any of anything for that matter, it's too young to blame yet. But with the first generation who grew up exposed to computing comparable to modernity, now maturing, its natural the industry will mature also. I see the brake on maturation more as lots of great new tools, than moral or human lacking. But self appointed grown ups trying to bully tax us, might be the natural parasitic compliment to this rich novel ecosystem. We don't need no random adults to appoint to combat this, we just need to question and talk about what is sane to accept. There's too much over reaching paternalism propping up big business assumptions, right now.
Re: Prepack helps make JavaScript code more efficient
#123This has promise but still needs more work. I added one line to their 9 line demo ( https://prepack.io/repl.html ) and it ballooned to 1400+ lines of junk: (function() { function fib(x) { y = Date.now(); // the useless line I added return x 42) x = fib(10); global.result = x; })(); I understand Date might not be acceptable for inner loops but a lot of my code that deals with scheduling would benefit significantly if…
If you replaced the line with say: `var y = 4;` you'll notice that it has been optimized out.
Re: Prepack helps make JavaScript code more efficient
#124This is cool–it's worth mentioning that you might be trading runtime performance for bundle size though, here's a contrived example to demonstrate: http://i.imgur.com/38CR3Ws.jpg
Keep in mind that everything is gzipped nowadays, so it may not make a big difference in network usage. Although it is still likely to cause some memory overhead
Re: Prepack helps make JavaScript code more efficient
#125Awesome project, the performance gains seem real, but why wouldn't these optimizations be happening at the javascript JIT level in the vm? (serious question) React / javascript programming, is the most complex environment I've ever dug into, and it's only getting more complex. create-react-app is great for hiding that complexity until you need to do something it doesn't support and then it's like gasping for air in a…
vs.
run through JIT compiler -> download js -> execute
Whatever overhead the JIT compiler adds will be latency for the user.
Re: Prepack helps make JavaScript code more efficient
#126Awesome project, the performance gains seem real, but why wouldn't these optimizations be happening at the javascript JIT level in the vm? (serious question) React / javascript programming, is the most complex environment I've ever dug into, and it's only getting more complex. create-react-app is great for hiding that complexity until you need to do something it doesn't support and then it's like gasping for air in a…
Re: Prepack helps make JavaScript code more efficient
#127Re: Prepack helps make JavaScript code more efficient
#128Earlier quoted context omitted.
And the weakness, legally speaking, of implicit patent grants was one major reason why GPL moved from v2 to v3. Explicit is much much safer for users of software, legally speaking, because implicit grants have to be settled in court . If you really want to go to court over it, and can afford it, then you may be right. Want to test that against Facebook? They reasoned (quite rightly) that it would be silly to suggest…
I can read and understand the MIT or BSD licenses. That is an extremely valuable property of a contract to me. Both clearly state that I may modify and distribute the software. Adding a huge pile of details about what exactly that means makes me rather nervous. I am not a lawyer, and I worry that somewhere in that huge pile of explicitness that there are consequences that I don't anticipate, and that don't match up w…
(This is why companies have legal teams.)
Re: Prepack helps make JavaScript code more efficient
#129Coming from a non-CS background, I've always wondered why you can't "convert" code from one framework or paradigm to another. For instance, converting a project from jQuery to React. If you can define the outputs, why can't you redefine the inputs? That's what it seems like this project does... I suppose converting frameworks would be a few orders of magnitudes harder though.
Can you convert a code base to React from Angular? Maybe, but the effort to write this converter is higher than rewriting the code base.
Re: Prepack helps make JavaScript code more efficient
#130This is cool–it's worth mentioning that you might be trading runtime performance for bundle size though, here's a contrived example to demonstrate: http://i.imgur.com/38CR3Ws.jpg