~80% Simulation Speedup & CircuitLab Browser Shootout

Aug 02 2012, 4:00 PM PDT · 7 comments »

Today we've deployed a new version of our core matrix routines which solve the hundreds to thousands of simultaneous differential equations generated from a single schematic. These updates include both algorithmic and implementation changes in the equation optimizer and sparse matrix LU factorization that power CircuitLab's analog simulations. Across our internal simulation testbench, we've measured performance gains of 30% to >100% on individual circuits. While the degree of speedup will vary greatly from case to case, we've clocked our total internal benchmark to be approximately ~80% faster. Faster simulations allow our academic, hobbyist, and professional users to iterate faster, and this performance boost makes CircuitLab a useful tool for a wider range of design and analysis problems. As usual, CircuitLab users can immediately take advantage of these improvements by launching a new editor session, with no software installation necessary.

As CircuitLab's analog and digital circuit simulations run entirely client-side in the user's web browser, we are reliant on the rapidly-improving performance of browser JavaScript engines to deliver the calculations our simulations require. While other websites track or measure general cross-browser JS performance, we made our own measurements specific to circuit simulation. We ran our testbench of simulations (including a variety of DC, time-domain, and frequency-domain simulations) against our old and new matrix library under four browsers*, and here's what we measured:

javascript matrix library CircuitLab

Lower runtimes are better, indicating that the tests finished faster. We've normalized all benchmark run times against the current winner, Google Chrome, with Mozilla Firefox close behind. As the benchmark data makes clear, we significantly improved performance across all browsers. Coupled with last month's simulator feature improvements, these performance enhancements continue to improve the capabilities of the CircuitLab toolset from all angles.

Let's take a look at the analysis of a relatively simple switching power supply circuit:

This is a buck converter, which allows a high voltage / low current power source to efficiently drive a lower voltage / higher current load. It does this by storing and discharging energy in an inductor in a controlled fashion. This type of switching power supply is found in many places in our everyday lives, delivering clean low-voltage power to a laptop's CPU, or in the LED-based solid state lighting solutions that are now making their way into homes and businesses. In CircuitLab, we can model a buck converter quickly, and then easily test different components or values or configurations. With our old matrix library, this circuit took about 26.7 seconds to simulate, but with our new update, it simulates in just 12.4 seconds -- that's a 115% speedup!

At steady state, this buck converter delivers about 16 watts into a 2 ohm load at ~90% efficiency:

Faster simulation time means we can generate results and try another idea more rapidly: Smaller inductor? Synchronous rectification? Faster switching frequency? Effect of inductor ESR? Closed loop feedback control? These are the questions that power electronics designers explore as they strive to make their designs better in every dimension: more efficient, less electrical noise, smaller, more robust to input and output conditions, more robust to component variations, cheaper... By coupling an easy-to-use interface with a faster simulation engine, designers can formulate and test hypotheses, make improvements, and ship better designs faster.

* Browser versions used in this test include: Google Chrome 20.0.1132.57, Mozilla Firefox 14.0.1, Apple Safari 5.1.7, and Opera 12.0.


Why not IE9/IE10? The only reason I can think off is that you guys are not running Windows, or else they are excellent alternatives, and no, I am writing this comment using Google Chrome. I am no fanboy of MSFT.

by vaibhavgarg
August 02, 2012

Hi @vaibhavgarg, actually, all of these benchmarks were run on a Windows machine. It's simply a matter of prioritizing our developer resources, and at the moment we have a lot of priorities that come first. (Also, our data indicates that tech-savvy engineers & early adopters don't tend to be IE users these days.)

I want to point out that we aren't going out of our way to actively block or IE users or use other vendor-specific features, and we simply display a "Browser compatibility warning" message. It's just that IE doesn't handle the same code that our officially supported platforms (Chrome/Firefox) run just fine.

by mrobbins
August 03, 2012

I was wondering why CircuitLab was suddenly running so much faster on my Firefox.

I love this web resource, guys. This site is a beautiful piece of work.

by anubi
August 07, 2012

Nice update!! I am using Circuit Lab in my classes. Besides making simulations in class, I ask my students to make homework simulations. They don't need to install any software, I can share my circuits with them, and they have access to lots of other people's circuits. It is a really great software! Congratulations!

by felipe.n.martins
August 19, 2012

Seems to run great in Windows 8 with IE10!

by mrcalico
November 09, 2012

you guys are gorgeous

by dino.lupo
January 06, 2013

Your simulation graphs are sooooo ugly, man.

by endolith
May 16, 2013

Leave a Comment

Please sign in or create an account to comment.

Go Ad-Free. Activate your CircuitLab membership. No more ads. Save unlimited circuits. Run unlimited simulations.
Blog RSS/Atom Feed

About CircuitLab

CircuitLab is an in-browser schematic capture and circuit simulation software tool to help you rapidly design and analyze analog and digital electronics systems.