River Trail — Intel's Parallel JavaScript
mikejuk writes "Intel has just announced River Trail, an extension of JavaScript that brings parallel programming into the browser. The code looks like JavaScript and it works with HTML5, including Canvas and WebGL, so 2D and 3D graphics are easy. A demo video shows an in-browser simulation going from 3 to 45 fps and using all eight cores of the processor. This is the sort of performance needed if 3D in-browser games are going to be practical. You can download River Trail as a Firefox add-on and start coding now. Who needs native code?"
What about a beowulf.js cluster of these?
Trolling is a art,
CPUs
the concept of assigning more than 1 cores to a single thread
Computing doesn't work that way. At least not with any meaningful speed increase. That may decrease power usage, but you'll still need "parallel programming shit" to make proper use of parallel processing hardware.
People who don't have 8 cores available and who want acceptable performance? People who want their Windows 8 tablet to have a real world battery life longer than two hours?
There are 4 boxes to use in the defense of liberty: soap, ballot, jury, ammo. Use in that order. Starting now.
anyone who recognizes you'll pay a pittance to the browser for your share of the fun.
Good people go to bed earlier.
Ha ha, a 15x speedup by going from 1 to 8 cores? No. It's hard to invent a situation in which you would get a genuine 8x speedup, let alone somehow making each core almost twice as fast.
We need some sort of metrics here. The I Programmer article content here is using only 314x1213 pixels on my laptop. The whole page have 1160x2078! Only about 16% of my screen area is the article's content. This is like listening to 50 minutes of commercials every hour on the radio. No one would accept that on the radio and I say we shouldn't here. Thanks!
We already have Web Workers, they just can't access the DOM. Why can't they just try to improve the existing framework instead of inventing their own?
...could use a bit of multicore speedup itself.
Not entirely. One of the features of Sun's cancelled Rock CPU was something they called Thread Scout. The idea was to run one core ahead of another, skipping most computation, to pre-fault memory addresses. This ensured that data was in cache when it was needed. There was also an idea to use multiple cores to extend the superscalar concept, so when you encountered a branch one core took each potential path and you discarded the wrong one. A lot of GPUs used to do this, but no general purpose CPUs (that I'm aware of, although ARM and Itanium do something similar with their predicated instructions).
You're right that you won't get the full benefit of writing proper concurrent code, but you will get some.
I am TheRaven on Soylent News
If your GPU sucks, try to get people to buy 8 CPU cores and do graphics on those. Seriously, doesn't WebGL allow use of the GPU? If not, fix that.
wait time bound magic.
multiple independent processes on a single core can cause a speedup over the same tasks in a single process because other processes can run while one is waiting for IO.
It's frightening how rumpsmackingly crap JS is as a language, yet it seems to be the Next Big Thing for software development according to all of the dribbling articles I keep reading about it.
So... what? It's an advanced form of out-of-order execution. Big deal, it's been around a LONG time. Revolutionary my ass.
Remember to maintain your supply of
Javascript's not a bad language. The pain in javascript programming is usually caused by the DOM and browser cruft... and you'd have to deal with that regardless of what web-scripting language you used.
I see no problem at all with a parallel version of JavaScript. But the question I have is who is really going to use this? Granted, some might say "anyone who wants to make money, this is the future of gaming and entertainment". I certainly hope it isn't! Is a browser really the platform of choice for high performance graphics? I think not. Is there anything really wrong with having a native client to produce something so specialized as a graphics intensive platform? Must we really look to a future where everything runs inside of a browser?
There was also an idea to use multiple cores to extend the superscalar concept, so when you encountered a branch one core took each potential path and you discarded the wrong one.
Given how accurate branch predictors are, what's the point in computing the non-predicted paths?
Not entirely. One of the features of Sun's cancelled Rock CPU was something they called Thread Scout. The idea was to run one core ahead of another, skipping most computation, to pre-fault memory addresses.
That was done back in the days with the original 68000. They were put in tandem in some machines, and one processor ran slightly ahead of the other. If it hit a bus fault, the second 68000 was used to recover, as the original 68K could not recover normally from a bus fault. Obviously this was not for performance purposes, but rather for reliability, but it's amazingly similar.
The oh-ten could recover from bus faults, and the 020 had a full-scale (although external) MMU option, so the technique ceased to be used.
That means the animated ads can now suck up all of my CPU, rather than just one core's worth. I can't wait!
That is all.
Instead of get a 50$ graphics card and play Doom3 on it, we need now 8 cores CPU to play JavaScript games in the browser? That is the bright future we can look for with ChromeOS and "the browser is the OS" future?
http://www.mueller-public.de - My site http://www.anr-institute.com/ - Advanced Natural Research Institute
but rather prefer to use them for something meaningful but the weirdly scrolling ad annoying them in some partialy visible background window....
According to this page, RiverTrail "adds the ParallelArray data type to JavaScript [...] accessible by functions like combine, filter, map, reduce, etc. which perform work in parallel." Hope that saved you some searching.
Visit http://ringbreak.dnd.utwente.nl/~mrjb/growingbettersoftware to download your free copy of the book
Why should an application decide the best way to split a load over multiple cpu cores? How does it know what else is going on in the OS to balance this load? Shouldn't the OS handle this behind the scenes?
Now all we need is a "sleep" function.
Visit http://ringbreak.dnd.utwente.nl/~mrjb/growingbettersoftware to download your free copy of the book
Just to make sure I got this straight:
Intel took one of the slowest interpreted languages, though the most popular one, and added parallel data primitives and functions. Then they used a pointless little particle fountain demo to show off its benefits.
So rather than try to make Javascript execute faster, they spread its disease to all 8 cores. How is this an improvement ? The last thing I want is for a web page to sap my CPU and battery life, doing things web pages should not be doing in the first place. Save that Javascript for friendly client-side form validation and UI animation. Everything else is a hack. 3D graphics in the Javascript is a hack. Heavy number crunching in Javascript is a hack. Fuck off with your hacks! If I want fancy graphics and high framerates, I'll run native code.
-Billco, Fnarg.com
Web workers takes care of this and launches things in different processes. The only browser that doesn't support it is IE, but that will change with Windows 8 next spring.
It can take care of this without Intel's code
http://saveie6.com/
I have a couple benchmarks i've run over the years, in multiple languages. For CPU intensive jobs on the same machine:
C: 1
Java: 1.1-3
javascript: 117
Javascript is in IE8 on win xp.
Javascript on IE has restrictive time limits for execution, though there are work arounds.
But If you have 8 cores, you're still 14.6x slower than C.
IMO, Java, which already runs in the browser, is the better solution. That said, compared to C, Java also has huge memory requirements.
It would make more sense to allow mutli-core execution in Java in the browser.
-- Stephen.
It might not only be out of order execution. It might must be cache. 8 cores certainly run on more than 1 L3 cache. More cache=>(possibly superlinearly) faster
I think all functional langs do that
-- no sig today
Interesting.
Google Native Client can run C++ multi threaded in a browser using pthreads.
java applets can run multi threaded. I bet a lot of other extensions can do multi thread too, maybe even shockwave? I guess the point about this is that it looks like javascript, ughh.
world was created 5 seconds before this post as it is.
Time to wake up. A good part of the world runs on Linux, starting with Google, Facebook, Android ...
How can it be a troll and the guy not know anything at the same time..
Mod parent up +1 Down To Earth.
I know tobacco is bad for you, so I smoke weed with crack.
You do realize you are responding to a troll, right? This guy is just some loser php "programmer" who knows jack and shit about real programming.
flamebait? what's that shit about allways picking on php? you could even do parallel programming in php