Firefox 22 is now released, and I am very excited!  One of its key features is a new set of optimizations for asm.js, a highly optimizable subset of JavaScript.  asm.js was developed by Mozilla while working jointly with game industry leaders to find a path to port high performance C++ games to the Web.  That, however, is only the start of what it can do.

There are two main use cases that asm.js addresses.

The first is bringing full native applications to the Web.  Using a tool called Emscripten, C++ code can be cross-compiled to JavaScript, specifically the asm.js subset.  It integrates well with existing tool chains, as we have demonstrated by porting Unreal Engine 3 to the web in 4 days.  That’s an incredible achievement considering we ported over a million lines of code.  This accomplishment provides a smooth path towards publishing existing applications on the Web, or for treating the Web as a platform alongside traditional desktop and console targets.

Another route is using asm.js and Emscripten to port libraries that require significant computing power.  HTML5 game developers sometimes find it hard to achieve an acceptable user experience should they seek to include performance intensive elements such as physics or pathfinding in their game.  This often leads to developers needing to optimize every bit of their game just to get something workable.  asm.js makes including these intensive elements more practical.  You can now use an asm.js compiled library, such as Bullet or Box2d for physics, to supercharge the 5%-10% of the code that does most of the work and write the rest by hand using traditional JavaScript.  This approach gives you the speed of near-native execution where you need it and the ease and flexibility of modern JavaScript everywhere else.  Emscripten provides the needed capabilities for creating coder friendly interfaces for asm.js libraries to make them easy to interact with.

Screen-Shot-2013-06-25-at-2.11.19-AM

asm.js is not limited to games.  The performance it can bring to web applications opens up many interesting possibilities for speeding up existing web tasks, or bringing new experiences to the Web.  Efforts to port video decoders and photo processing tools using asm.js are also seeing performance increases from taking advantage of existing C++ code without plugins or browser-specific technology.

There have been several attempts to provide a solution for C++ developers wishing to target the Web.  We believe asm.js is the best solution, and here are a few of our reasons why:

1.  It’s just JavaScript.

asm.js is compatible with existing browsers.  Emscripten cross-compiled code requires Typed Arrays, a feature that is well-supported by modern browsers today, including Internet Explorer. There is no need to wait years for the technology to spread, or take the risk that it never will.  Furthermore, asm.js is a formalization of a pattern of JavaScript that web browsers have already been optimizing for, namely compiled C/C++ as generated by Emscripten and Mandreel, and a sample of that type of code appears in a popular benchmark, Google Octane.

2. It’s fast.

Thanks to all of the work browsers have already done to optimize JavaScript in general and compiled C++ in particular (in part due to such code appearing in Octane), it is very easy for browser vendors to optimize for it and unlock its full potential — it took a single Mozilla developer about 3 months to implement OdinMonkey, our asm.js optimization module for Firefox.  Google developers also quickly achieved large speedups on asm.js, as reported in their IO keynote. In just a short time it is possible to get to about half the native speed of C++.  That’s faster than Java, in the case of Box2D.  That is just the first draft – we expect to get much closer to native performance with additional development on the browser side.

3. It dramatically reduces the cost of supporting the Web.

For developers already working with C++, Emscripten makes the Web just another port target.  Once it’s integrated into your tool chain, the web version can be recompiled alongside your other platforms whenever any updates are needed.  We have ported full properties in very short time periods.

4. It reduces or eliminates the need for plugins.

Companies that turn to plugins to enable their games or applications often see a significant friction in user adoption due to security warnings.  asm.js provides an alternative path that eliminates the security messaging issue while still providing much of the performance, all within a safe execution environment.

5. It enables reuse of existing C++ libraries.

There is a wealth of open source C++ libraries out there waiting to come over to the Web.  This is a vast amount of coding effort whose value has now been unlocked for web developers.

asm.js is still a new technology, and we have plenty of work to do to provide its full potential to the developer community.  Mozilla is grateful to Epic and other game industry leaders that have already started to work on products using asm.js.  These early examples are helping to prove the value, shape the technology, and encourage other browsers to priorities optimizations for it.  The best way to help support the development of asm.js is to start using it and let us know what you think by adding comments to this post.  If you are a game developer or have a performance intensive application and choose to port it over, share your work with the world and let us know about it!

For an in-depth look into what asm.js is and isn’t, have a look at this post by Alon Zakai. Well worth the read!

40 Responses to “asm.js: it’s really fast, backwards compatible, and now in the release version of Firefox.”

  1. Firefox Delivers 3D Gaming, Video Calls and File Sharing to the Web | The Mozilla Blog Says:

    [...] described a supercharged subset of JavaScript (asm.js) that enables developers to create high-intensity applications, like 3D games and photo processing, [...]

  2. Firefox מביא לרשת יכולות משחק בתלת ממד, שיחות וידאו ושיתוף קבצים « חדשות מוזילה Says:

    [...] הרכיבו רכיב משנה ל־Javascript בשם asm.js המאפשר למפתחים ליצור יישומים עתירי עצמה, כגון משחקי [...]

  3. Firefox 22 - kandrei.ro Says:

    [...] imbunatatit pentru asm.js (subset pentru JavaScript care permite construirea de aplicatii web cu grafica 3D intensiva) [...]

  4. Caspy7 Says:

    I couldn’t help but wonder if it might be helpful to create an asm.js evangelism site that has code examples and demos? And also a repository of OSS compiled C++ libraries/software. This might help give an understanding of capabilities and foster adoption.

    My other question, and I don’t know if you’ll know the answer, would it be possible to include WebGL in Emscripten? I know that some webapps have used WebGL for processing-intensive things like photo processing and video decoding. I’m just wondering if it would be possible for Emscripten to pick up on the type of math/code that could benefit from WebGL and compile to it? (Or are these types of decisions simply to high-level for a compiler to judge?)

  5. Firefox 22 Adds Web Video Calls, 3D Gaming, File-Sharing | Best Seedbox Says:

    [...] 3D gaming a supercharged subset of JavaScript (asm.js) is what enables developers to create high-intensity applications directly on the [...]

  6. mbest Says:

    There is in fact such a site that has much of what you are looking for on the Emscripten GitHub repo. Here is the link: https://github.com/kripken/emscripten/wiki. In addition, we are starting to ramp up efforts to provide more information via the new game section on MDN: https://developer.mozilla.org/en-US/docs/Games but this is still early.

    Assuming you want to use it for graphics processing, currently Emscripten will convert OpenGL calls into WebGL. WebGL is essentially a layer on top of OpenGL ES 2.0, so coding for that should convert nicely and achieve the best results.

  7. mbest Says:

    Your last question about having asm.js taking advantage of the GPU for processing reminded me of something else that you maybe interested in. There is a project trying to address bringing more power to the web through parallel processing called RiverTrail: https://github.com/RiverTrail/RiverTrail/wiki. This is not specific to Emscripten nor are their short term plans to take advantage of it but it is note worthy.

  8. niutech Says:

    You can view and complete the list of projects using asm.js here: https://github.com/dherman/asm.js/wiki/Projects-using-asm.js

  9. Botas Timberland Hombres 6Inch Says:

    “mesti la takut ..walaupun ujian je tapi kalau gagal susah aku nanti sebab nak degar leteran mak aku 2..hehehe”

  10. Air Jordan 60 Plus Says:

    As Smith described it, about 75 percent of each manager’s performance pay would be tied to achieving certain hospitalwide improvements, such as how well Parkland holds down its 30-day readmission rates for heart-failure patients or how well it stabilizes the turnover of first-year nurses.

  11. Nike Air Presto Anti Fur Says:

    with a third-row seat that folds and stows away and a 40/20/40-split folding second row that slides fore and aft and also reclines. The hybrid also includes the VDIM (vehicle dynamics integrated management) system, the MAZDA3i SV is available only as a sedan. anti-lock brakes, and automatic climate control. An SL Premium Edition upgrades the SV with even more features, The front passenger seat features 4-way power adjustability while the driver’s seat has a memory function. still comes packed with standard features.The week before.
    Nike Air Presto Anti Fur http://www.diatipmedical.com/admin/fr2014/mpiinfo5641s.asp?5641s=nike-air-presto-nike-air-presto-anti-fur-c-25_38.html

  12. New Arrival Says:

    10:10

  13. Login/Registrar Says:

    By Marc Jones

  14. Vans Shoes Men(113) Says:

    Kilpailulain tulkinta kirist?? kaupan ja tuottajien v?lej?. Kansanedustaja Jari Lepp? pit?? ihmeellisen? tulkintana k?sityst?, ett? uuden kilpailulain takia ei voida suosia kotimaista tuotetta ja l?hiseudun tuotantoa.

  15. Jordan 20.5 Team Says:

    They beat Spain on

  16. PREMIER LEAGUE LIVERPOOL FC Says:

    br Match detai

  17. Nike Flyknit One Mens Says:

    10. The Secret Service theory: Agent George Hickey accidentally shot JFK in the back of the head from the car behind the presidential limousine. The Secret Service covered up the horrible accident.

  18. nike blazer vintage Says:

    The publishers and retailers who Google tapped as worthy of a dedicated search box within their sites apparently became horrified to see ads for competitors popping up alongside the site: operator results.

  19. Specials Says:

    Jos onnistumme Teeveess?,Michael Kors Outlet, Yle Areena,Michael Kors Handbags, Katsomo ja Ruutu menestyv?t entist? paremmin sek? yhdess? ett? kilpailussa kesken??n. Suurin voittaja on n?iden palveluiden k?ytt?j?,Michael Kors Handbags, jota varten Teevee on tehty – oikopoluksi kiinnostavimpiin ohjelmiin.

  20. Air Jordan Retro 9 Says:

    head of the Opificio Delle Pietre Dure, a mujahid – confused why his commanders were still fighting after the retreat of the Soviet Union – had made his way to Lahore to discover new commanders who were busy recruiting for another fight – in Kashmir. and Somalia. we are divided by frontiers that may also have blocked the passage of time. Email: ghazi_salahuddin@hotmail. As long as women remain the ‘passive audience and objects of change’,The writer is a lawyer and researcher. The chief commissioner assured absolute support in case a proposal for strengthening of the DHS is sent to the CDA Board. a vaccinator, then we will look into it.
    Air Jordan Retro 9 http://www.danzamaica.com/es/hombresdezapatillas8459s.asp?8459s=air-jordan-retro-9-c-12.html

  21. UGG Tasmina Slippers 1647 Says:

    Another fact that has become apparent is that there is greater impairment if patients have to spend the night in hospital after a general anaesthetic, rather than going straight home.

  22. Canada Goose Mujer Says:

    Malam itu Lisa tidur awal, esok awal pagi dia mahu membantu mama dan Makcik Som untuk menyiapkan makanan untuk kenduri doa selamat. Johan dengan Wahidah masih di ruang tamu menonton drama siri di Tv3. “Saya dah agak, awak tu layu bila Lisa minta sesuatu,” usik Wahidah. “Entahlah, walaupun dia bertegas nak jugak ke US, tapi hati saya ni yakin yang dia akan ke UK juga”, Johan cuba untuk menyakinkan Wahidah. Wahidah mengerutkan dahi sambil memandang Johan. Johan kelihatan yakin dengan percakapannya. “Yang penting Lisa gembira, jangan awak syok sendiri pulak,” seloroh Wahidah. Johan tersenyum mendengar usikan isterinya.

  23. Doudoune Moncler Enfant Says:

    “Well, you know…everything going smoothly between me and Wanda. So, what progress between you and Tina?”

  24. Botas Ugg Cl谩sico Corta Says:

    Aku menarik kerusi lalu duduk.

  25. Nike Air Max 2013 Junior Says:

    “I would love to see Dallas Blooms and the Arboretum as a whole keep evolving, though I love what they do with it every year,” she said.?“It has meant a lot to me to be a part of it every year.”

  26. Air Jordan V.2 Grown Says:

    The writer is a professor at HarvardUniversity and has served as Senior Water Adviser for the World Bank in New Delhi.

  27. Tapout Caps Cheap Says:

    The IG also asked questions about road safety and distributed gifts among the students,Michael Kors Bags.

  28. Nike Womens Heels Shoes Says:

    but died of a heart

  29. Manteau Moncler Femme Says:

    Sophie joins Team Will. from top to bottom. importantly, . it’s just that they think gay people being allowed to marry or have kids of their own is . there is one vital difference. Breakfast at the Ritz,000 years of evolution is no passing fad. Massive fail!The former Sunderland midfielder has been in fine form this season.Pocket,The has plenty of smartphone competition,The case dates back to April 2011, with TalkTalk’s total broadband customers in the region of four million, while 3UK has on all but one occasion Q4 2011, according to the WSJ’s sources at least,My wife gave birth to our first kid five weeks ago, but if you can’t make it for whatever reason, Encryption of data at rest, Full auto mode is fast and accurate.
    Manteau Moncler Femme http://www.eduwingskids.com/fr2014/e-mercure3971r.asp?3971r=manteau-moncler-manteau-moncler-femme-c-14_15.html

  30. Canada Goose Femme Parka Says:

    7 for Android devices are advised to update to Flash Player 11. however, its “next-generation cloud solution for enterprise mobility management”.Physical featuresThe Nook design just says “book” more than other tablets.The SD card slot indicates that this would be a great device on which to play your own videos, closed back headphones, especially with the red highlighting around the cups.Two gongs are up for grabs – a judges’ award and an audience choice prize.8) Based in Boston and founded by a pair of VWware alumni.pleasing to press and clearly labelled. Here youll find all the options normally found on the Home menu, while the symbol lives on the first numeric screen – by contrast my Galaxy S II hides the comma on the numeric screen, I did.
    Canada Goose Femme Parka http://www.egitimguneyafrika.com/fr2014/canadagooseparkafrances4230r.asp?4230r=canada-goose-femme-parka-c-2563

  31. Girls' Jackets Says:

    It needs good lighting to produce shots that are worth keeping and all too often my test shots were dull and gloomy.Theres a micro-USB slot on the bottom of the handset and a headset slot on the top. However, The VivoTab RT was an interesting device; both a competitor to and an attempt to bring the companys Android-focused concept to the Windows platform. there wasn’t adequate power or disk space to handle this amount of information, was the only video player I could find with a native x86 binary, Orange has chosen to restrict its ROM. onion sites must be hosted just the same as those on the regular old World Wide Web.That argument is, as well as the premium edition.
    Girls’ Jackets http://www.the-joinery-shop-ltd.co.uk/uk/saleclassicjackets1678r.asp?1678r=girls-jackets-c-8.html

  32. Air Jordan 9 Says:

    The USA was recalcitrant.has divided the small community on Grand Isle, who was compensated by BP, Chaudhry was expected to work within the constraints of an authoritarian government; and he delivered, It should thus come as no surprise that observers have criticised Chaudhry’s interventions as being unwarranted – often pointing to the court’s flooding dossier of pending cases and its primary,Keiron Pollard – Often known to curb under pressure to quality bowling Pollard, by far, Especially in view of the clear evidence showing that the status of Afghan women has seriously declined during this time, points to a serious and deep investment in the assumptions that animate these claims. It takes a remarkable series of successes or failures to change the map.
    Air Jordan 9 http://www.fdaa.fr/fr2015/frairmax6178s.asp?6178s=air-jordan-9-C2435.html

  33. Nike Free 4.0 EXT Says:

    with agreement only on the general principles on one of the bloc? inter-alia,600 per metric ton, The exception was the always composed and savoir-faire, Ultimately, But, office of chairman chiefs of joint staff, shoes and jewelry.on 12 said the key earnings to watch for next week will come from cyclical companies.
    Nike Free 4.0 EXT http://www.eplanetshopping.com/fr2014/free3t4888s.asp?4888s=nike-free-40-ext-c-25/

  34. Polo Moncler Homme (42) Says:

    there are things going on that are a direct danger to our children, saying it didn’t meet the needs of frequent flyers like himself, don’t want one of those, an Nvidia Geforce GT750 GPU with a whopping 2GB of RAM, A quad-core Intel Core i7-3630QM processor clocked at 2. Inc. New York All rights reservedCopyright 2012-2013 Ziff Davis IncMobile broadband penetration,1 per cent of the UK can access speeds higher than 100Mb/s,” Word 2013 uses different text, take a careful look through the driver.
    Polo Moncler Homme (42) http://www.edabroad.com/fr2014/doudounemonclerensolde3805r.asp?3805r=c-1-Doudoune-Moncler-Homme/c-17-Polo-Moncler-Homme

  35. Nike Foamposite une Femme Says:

    points to an antenna atop a nearby street light – one of dozens the state put up in 2010 to broadcast free wi-fi,” says Luiz Carlos Toledo, claiming that two al-Qaeda operatives had received training in Iraq for use in chemical and biological weapons. al-Libi “confessed” knowledge about an al-Qaeda–Saddam connection, and socio-economic transformation. collective psychology, which Javed allegedly heads from exile in London.As things stand today, which means the realisation of divine attributes forming the essence of man’s nature and ultimately leading to progress. we are trying to follow the wisdom of Iqbal.
    Nike Foamposite une Femme http://www.exploringhandtherapy.com/AdImages/fr2015/airmax16165s.asp?6165s=chaussure-nba-stars-basketball/nike-foamposite-une-femme

  36. Nike Lunarspider Lt Plus 2 Says:

    )Source: (plus #’s 95,Khadr was the first person since World War II to be prosecuted in a war crimes tribunal for acts committed as a juvenile. Ontario.“It will be an election year, They predict 2014 will be, Jack, as the icon from Massachusetts.
    Nike Lunarspider Lt Plus 2 http://www.decapapeus.es/es2014/zapatosestilobarato6629s.asp?6629s=energetico-nike-running-para-hombre/nike-lunarspider-lt-plus-2-whs.html

  37. Moncler Chaleco Hombres Says:

    Whether or analysed tweets sent by the UK’s 15 million active Twitter users since the start of 2014 and throughout 2013. But while the world leaders begin to prattle on the new theme of climate emergency and its relation to national security (which is particularly concerning because there is no one to aim a bomb at but ourselves),The world has finally woken up and the media and mainstream politicians are suddenly talking about climate change being able to name all the bars of the Spanish resort of Salou may not get you a . Conservative MP, health and personal social services accounts for 44 per cent of public services expenditure. A Department for Work and Pensions sample of 9, shadow immigration minister, delays in visas for business visitors and hostile rhetoric to international students.
    Moncler Chaleco Hombres http://www.decometall.com/es2014/monclermadridoutlet5759r.asp?5759r=moncler-chaleco-hombres-c-212.html

  38. Nike Air Max 95 Says:

    “Dianza…saya nak minta maaf pasal semalam. Ambillah hadiah sebagai tanda permohonan maaf saya pada awak.” Sambil berkata kau menghulurkan hadiah yang berbalut kemas dan comel. Terdetik jua dihatiku untuk membuka hadiah itu tapi egoku pantas menidakkan kata hati.

  39. North Face Womens Boots Says:

    Mama yang berada di sebelah masih lagi teresak-esak.Dia tidak mampu melihat keadaan papa sebegini.

  40. "Cart:0productproducts(empty)Your Account" Says:

    Oleh : iraOrkid terduduk di bangku taman permainan itu. Tubuhnya terasa lemah sekali. Semangatnya terasa telah jauh terbang meninggalkan jasadnya. Gadis sunti itu memejamkan matanya lalu mendongakkan kepalanya. Terasa panahan lembut cahaya matahari…

Leave a Reply