thinkstockphotos178804327100609669orig

Cheerp creator: Our C++-to-JavaScript compiler beats Emscripten

Cheerp, a C++ compiler that generates JavaScript code for use in any browser, is being upgraded this week with improved performance, reduced output code size, and  backing for 64-bit integers.

Open source Cheerp, from Leaning Technologies, is based on LLVM, which features a set of modular, reusable compiler technologies. Version 1.2, introduced this week, "comes with some big performance improvements, both in execution time and in startup time," according to a blog post by Leaning Technologies CEO Stefano De Rossi.

Cheerp reached a slowdown of  "only 2 to 6 times compared to native," while still allowing full dynamic memory management and no memory size limitations, the blog states. "Compared with Emscripten in split memory mode, Cheerp is always as fast but most often 2-3 times faster, has a 10-11 times faster startup, requires no effort from the developer to fine-tune compilation parameters, and allows for real dynamic memory management." The rival Emscripten compiler, which also leverages LLVM, converts C/C++ code into the Asm.js JavaScript subset.

In addition to native 64-bit integer capabilities, Cheerp 1.2 supports a PreExecuter capability, currently in an experimental state. "The PreExecuter is a technique that converts C++ code used to initialize global structures into simple data," De Rossi said. "Its main effect is a further reduction of the output JavaScript startup time and a much reduced output code size."

Also new in version 1.2 are Runtime Type Information support, dynamic_cast, and covariant return types. "Cheerp now also experimentally supports the module pattern to isolate generated code from other scripts," De Rossi said.

IDG Insider

PREVIOUS ARTICLE

« Healthy smartwatch growth seen after slow 2015

NEXT ARTICLE

16 employee engagement trends that will shake up IT in 2016 »
author_image
IDG News Service

The IDG News Service is the world's leading daily source of global IT news, commentary and editorial resources. The News Service distributes content to IDG's more than 300 IT publications in more than 60 countries.

  • Mail

Recommended for You

Future-proofing the Middle East

Keri Allan looks at the latest trends and technologies

FinancialForce profits from PSA investment

Martin Veitch's inside track on today’s tech trends

Amazon Cloud looms over China: Bezos enters Alibaba home ground

Lewis Page gets down to business across global tech

Poll

Do you think your smartphone is making you a workaholic?