Faster, smarter - the latest Online Compiler


We are happy to announce a faster, smarter version of the mbed Online Compiler, which is now rolled on the live servers.

There's a huge amount of changes behind the scenes, which will give a noticeable performance boost to all areas of the Compiler.

Faster

We've enhanced multiple aspects of the Compiler - rendering and interactivity, server requests and caching, and notably - the build system.

Render speed improvements

The mbed Compiler's responsiveness when rendering UI elements - Editor, panels, bars, buttons, tabs etc - is crucial for a positive experience when using the IDE.

This is highly dependent on your computer CPU performance and browser family, thus we took an older computer hardware configuration as a base for comparison and then implemented browser-specific optimizations for each browser family to maximize performance.

The chart below illustrates the improvements per UI elements per browser:

/media/uploads/screamer/ide_rendering_by_component.png?v=3

Information

Values may be different across computer systems, though the proportion between the values of the old and new Compiler should be the same.

"Other" represents rendering routines that have been optimized or dropped entirely, so they no longer consume CPU or rendering time.

The next chart represents the time taken to fully render the IDE when initializing and when resizing the browser window:

/media/uploads/screamer/ide_rendering_totals.png?v=3

These charts show that the fastest browser with the mbed Online Compiler is a WebKit-based browser like Chrome or Safari, though Firefox is still a solid option if you're looking for an alternative.

Server side improvements

The server side also plays important role in how one interacts with the mbed Compiler.

We have enhanced and enabled the server side caching for the whole IDE interface and in the same time we've reduced the number of server requests by joining most of the images in 2 distinctive image collections. By doing so the mbed Compiler now fully loads in under 1 second with 30% less requests:

/media/uploads/screamer/server-side_caching_and_requests.png?v=3

Information

This is also dependent on your internet connection. The values above represent the time taken to generate server responses and does not take into account your actual connection speed and delay.

Generating a list of revisions in Revisions History has been optimized for speed by reducing the number repository backend calls and improving the quality of the processed data:

/media/uploads/screamer/revisions_list.png?v=3

Build System

And last but not least, we've improved the build system, which is now over twice as fast!

This is due in part to a complete redesign of the build system, completed earlier this year. We now distribute build jobs evenly among a flexible number of backend build servers, ensuring both that performance is maintained even at our busiest times, and we can also easily add as many build servers as are required to meet demand. We currently handle about 2,100 compiles per hour, and the new system ensures we can scale to handle a lot more in the future.

That part addresses the scalability and reliability and gave a slight speed increase, but what has really boosted the compilation speed is the next improvement - we now simultaneously compile each of your source files in parallel across as many as 8 CPU cores. Once all the objects are created, we then link and prepare the binary as a final step. This change means that we can make the full use of our build servers, and you will hopefully see a noticeable increase in compile speed, especially for larger programs.

The chart below shows the comparison between the old and new Build System for 3 programs:

/media/uploads/screamer/build_system_-_clean_compile.png?v=3

The bigger the program is, the faster it compiles compared to the old build system!

We've also improved incremental (non-clean) compiles, for when you're doing incremental edits and compiles in between:

/media/uploads/screamer/build_system_-_incremental_compile.png?v=3

Give it a try for yourself, and you might even find that a program compiles faster using the mbed build system than on your desktop system - thanks to our investment in the mbed build system, which has been designed with horizontal and vertical scalability in mind.

Smarter

Definition lookup

In a previous mbed Compiler release we've introduced the Interactive mode feature, which allows quick definition lookups using Ctrl+click combo on words in code.

This now takes into account your currently selected board and attempts to filter out code definitions intended for other platforms in multi-platform libraries like the mbed SDK and similar libraries. Effectively it reduces duplicate definitions for when using such libraries.

The base convertor (when clicking numbers) has been enhanced to support clicking on floating point and negative numbers, and also reports the float/double precision and unixtime representation of a value.

The definition tooltip UI has been redesigned, with a better focus on the definition itself, yet we've kept the definition and documentation reference links as buttons.

The definition tooltip will also try to adjust to your screen size and the amount of data to be displayed in attempt to deliver better representation of the definitions:

Click to view in original size

Additionally it is no longer required to hold Ctrl - just click anywhere in code!

Warnings and errors during compile

Have you ever wanted all compile errors and warnings to be somewhat more visible? May be like highlighted lines in your code? Well, that's one of the new features of the mbed Compiler.

When an error or a warning occurs during compile, the Editor will highlight the reported lines in the currently open files, and will remember compile messages for files that aren't open yet, so as soon as you do it will highlight them as well.

The column number of a highlighted line can be clicked, which will display and position a tooltip with the compile message just under the reported location:

/media/uploads/screamer/compile_messages_in_editor.png

To clear highlighted warning/error lines you can either modify them or close and reopen the file to clear them all.

New program templates

We've added support for multiple templates when creating a program, including the option to create an empty program.

This takes into account your currently selected board and offers program templates which we verified to be working with that board and that are also interesting and/or easy to start with.

If you'd like a program of your own to be added as a program template for a board, then write us at support@mbed.org.

Other improvements

The following features have been enhanced to deliver a better or new functionality:

  • "Format Code" will format/indent only the selected code with text selections in the Editor.
  • "Compile Output" panel now supports selecting (including Ctrl+A combo) and copying of multiple compile messages. The format of the copied messages has been improved as well.
  • The column number for compile messages have been restored.
  • "All changes" in Revision History will now highlight code based on the mbed colorizing standard. It will also properly indicate line numbers for diffs.
  • A new dependency progress dialog will appear when attempting to commit, update or publish a repository. In the old mbed Compiler this was a silent check that especially on big programs can leave the impression that the Compiler has hung.
  • The "Who" field in Revision History will now handle email addresses, allowing you to click them.
  • The platform selection dialog is now slightly bigger and supports more than 10 platforms (virtually unlimited). Also the pinout images have been resized to fit better.
  • A new ZIP export option is available, which exports all internal repository files (.hg, .hgignore) of a program, allowing you to quickly setup an offline development environment. The legacy ZIP export option has been renamed to "mbed Online Compiler" and the new one replaces it.
  • The mbed Compiler now shows a "Beta mode" button if you have beta mode enabled. Clicking it will take you to the beta mode page if you want to turn it off. If you do - remember to refresh the mbed Compiler.
  • You can now convert mbed library builds into normal library with a single click by using the "Covert to Library" context menu option.
  • We've prepared a new introduction video to the mbed Online Compiler.

Final words

If you've read this far then you must be really excited about the new mbed Online Compiler!

Let us know what you think on http://mbed.org/forum/bugs-suggestions.

Happy coding!

17 comments on Faster, smarter - the latest Online Compiler:

21 Oct 2013

Amazing!! Thanks!

21 Oct 2013

Thank you for improving the online compiler. All these changes are actually available only in the beta mode, when will it become available in the "normal" mode?

21 Oct 2013

It looks really nice, thanks for your hard work!

-deleted-
21 Oct 2013

Martin Kojtal wrote:

Thank you for improving the online compiler. All these changes are actually available only in the beta mode, when will it become available in the "normal" mode?

We are aiming to release them this week along with new neat website features which will be announced soon. If you're happy with the new Online Compiler then you could still use beta until the official release.

Thanks for trying it out!

Cheers,
Mihail

21 Oct 2013

-deleted- wrote:

The platform selection dialog is now slightly bigger and supports more than 10 platforms (virtually unlimited). Also the pinout images have been resized to fit better.

Awesome! Does this mean we'll finally see support for the EA LPC11U35 QuickStart Board?

21 Oct 2013

Thanks for the awesome improvements! Might I suggest one more? I don't know if you found a solution for this already, but if you make the mbed compiler available as a Google Chrome Hosted App, then the web page should have the ability to write the compiled file directly to the mbed. Wouldn't it be great if users can just press one button to compile and load the program onto the mbed, without having to deal with the Downloads folder and dragging and dropping files? The Google Chrome stuff should be optional because it requires several clicks to set up, but then could allow much more productive use of the IDE.

Here is the API you could use to write the files: http://developer.chrome.com/apps/fileSystem.html

Actually, someone might be able to write this feature without modifying the mbed IDE at all; it could just be a new feature of the browser.

21 Oct 2013

David Grayson wrote:

Here is the API you could use to write the files: http://developer.chrome.com/apps/fileSystem.html

Actually, someone might be able to write this feature without modifying the mbed IDE at all; it could just be a new feature of the browser.

Hi David,

It looks like chrome apps run completely locally, inside the browser, so don't think this will work! Unless someone fancies implementing a c/c++ compiler in javascript... ?

We do however have plans which may lead to a fix for the download dialog annoyance.

22 Oct 2013

Hi Dan! A Google Chrome Packaged App is supposed to be all in Javascript and work offline, but I was suggesting that you make a Google Chrome Hosted App, which is basically a website with a little bit of extra metadata that gives it extra permissions. I might try to make a proof of concept... but I am worried because it looks like hosted apps only get a few permissions and it doesn't include writing to the file system, according to https://developers.google.com/chrome/apps/docs/developers_guide

23 Oct 2013

Some very nice improvements :)

Question: Is there a special reason IE is the slowest one?

Suggestions: Code completion, no idea how hard it would be, but it would be awesome.

Easy one: Now there is the option for different new program templates, it would be nice to also have it for a new class. So if you give it a name, you can either have the default empty one, or a standard initialized one. There I would then expect a .h and .cpp file with the same name as the library, in the .cpp file probably nothing besides including the .h, possibly an empty constructor. In the .h file the #ifndef [name of library in caps + _H], a class with the same name as the library, possibly public/private already there and possibly constructor.

I dare to say the vast majority of the mbed uses that, so would be handy if it can be automatically done.

-deleted-
23 Oct 2013

Hi Erik,

Short Answer: It's related to slow styles computing of DOM objects in quirks mode for the IE family.

Long Answer: IE has a strong tendency not to follow standards. Due to some inconsistencies in the box model, the mbed Online Compiler does tricks so the UI is rendered correctly in IE, almost exactly as it is rendered in Chrome, Firefox, Safari and even Opera. It also struggles when computing relative object dimensions even if the child object uses 100% of the parent. The latest caching tricks in IE10 didn't help much either even though overall it's faster than IE9.

All your suggestions are in our To-Do list already, though at this point I cannot promise any time frames or particular order of releases. As you said the New Classes is an easy feature, but we would like to explore more possibilities and eventually enable more use cases, e.g. New Class templates functionality with more than one template option.

Thanks for your feedback and especially for the suggestions. If you have more ideas then share them with us in the forums and we might implement them!

Cheers,
Mihail

24 Oct 2013

Hi,

First off, great work on improving the mbed IDE! I have a small suggestion: Is it possible for the compiler to also generate
a .elf with debug symbols? That way, I will no longer need to use an offline solution and I can still debug my code with a gdb
server like pyocd or jlink.

Cheers,
Timothy

30 Oct 2013

Hi,

Your IDE looks great and is quite speedy...but... I need an offline version, with proper documentation...

Your lack of good offline API docs is quite disappointing... Are mbed planning to release a proper PDF of the libs/classes?

Kind regards

Kevin

30 Oct 2013

Hi Kevin,

We have no plans to put the documentation into a PDF form at the moment.

I am interested in what advantages a PDF version would have however, so if anyone else wants this please let us know.

In terms of an offline version, we won't be providing our own offline IDE, but soon we will be improving and better documenting how you can use other IDE's with mbed. In the meantime, you can export your code - see http://mbed.org/handbook/Exporting-to-offline-toolchains .

Dan

30 Oct 2013

Hi Dan,

Your website is very nice and the way the online IDE integrates with the online docs is also really nice, but API's are normally available as proper document.

To answer your question about why I am asking about proper documentation. Here in the UK everything I own is connected to the internet, so developing and looking up the std lib/api here is easy. But I work in non EU countries, where internet is either not available on the sites of our customers or the location I am working from. I could likely use uVision, but need some proper documentation. If you are saying you guys aren't going to do this, then I will likely return my dev board to Farnell and find an alternative.

Thanks

Kevin

30 Oct 2013

Out of interest: Which documentation do you mean? Because the handbook/cookbook/component pages are obviously online. But the APIs are doxygen documented, so are also available offline.

Creating PDF documentation from that literally took me less than 5 minutes from 0 knowledge on how to do it: /media/uploads/Sissors/refman.pdf

Is it ugly? Yes it is ugly. But that happens when I get the first program I find, and since I don't have Latex installed I had to make the PDF from an RTF document. I now also have it as offline HTML document (consisting of 500 sub documents, so I can't just upload that one, unless it would be as zip), and that looks nice.

Regarding that @mbed staff, if I make the documentation using standard Doxygen it shows in a nice simple graphical form the inheritance structure. Would be nice also to have that in the online compiler. (Just like this: http://taylorpetrick.files.wordpress.com/2011/08/inherit.png), so simple, but a bit clearer imo than in the online compiler).

12 Nov 2013

Hi Erik,

Thanks for sharing, this is just what I was looking for..

12 Nov 2013

Ah that was what you wanted :)

FYI, and everyone else who wants something like that in the future: I simply used the standard doxygen software from: http://www.stack.nl/~dimitri/doxygen/. You have to read abit around on how to actually use it, but it isn't that complicated (although I wouldn't have minded a GUI). Then I just exported a standard mbed program for a random platform to a random toolchain. That gives a list of .h files of the mbed libraries. (+ The binary mbed files, but you don't need them for this). Copy those into the doxygen folder and it can make you the documentation.

You need to log in to post a discussion