MetaPulse Blog

View Original

Fast as Lightning

Photo by Sean McAuliffe on Unsplash

With just under 5,000 users logging in to update some 71,596 graphs, we took the next giant step to make envisage even faster.

What used to take minutes, now often takes less than a few hundred milliseconds (less than half a second).

Although a minute or two might not sound like a long time, keep in mind that a minute is a very long time in the computing world.

It’s about 600 times faster… so yeah… that’s a lot :)

How’d we do it? 

We changed two things.

Firstly, we changed the way calculated graphs work.

Secondly, we changed the way graphs display.

Realtime Calculated Graphs

Some of our users combine hundreds of graphs using our popular Calculated Graphs feature, adding together statistics from hundreds of sales people across multiple countries.  Prior to this upgrade, whenever a new value was entered, envisage would collect all of the data from each graph and perform a recalculation in the background. This task took a lot of time (many minutes sometimes) and also loaded up our servers with work. But worse, when you went to look at the graph, if it was still recalculating, all you got was the old data until it was ready.

Now, envisage calculates these values in realtime using highly tuned database queries specific to this task. The result is that the graphs update in realtime (in milliseconds).

For those of you with calculated graphs pulling data from many sources, you’ll notice a difference in load speed. You’ll also notice that we removed the “Recalculate” option from the graph menu as it’s no longer needed. You can read more about that here.  

Faster Display  

There are a tremendous number of variables involved in rendering a graph on your computer, such as the type of browser you use, your available computer memory, processing power, size of your screen, and internet speed — to name a few. 

Previously, envisage would load up to 10 graphs at a time in batches.  This meant that you would see about 10 empty graphs loading with spinners for a few seconds, then the next 10 would load and so on until all the graphs were loaded.

The issue with this method was that the speed of rendering was limited by the slowest graph. The browser had to wait until all 10 graphs had their data before it could display any of the graphs.  This meant that it felt slow and took longer to display.

Rather than load the graphs in batches, envisage now loads each graph individually, by firing off dozens of individual requests to the server, one for each graph. As soon as the data is returned, that graph displays.

The result is that the graphs start populating almost instantly. 

We also enhanced the system by rendering the graphs you can see as a priority and those off your screen will load once you start to scroll.

Finally, we improved how we cache the data on our systems, so the next time you load the same graphs, if they haven’t changed, they will display almost instantaneously.

Improved with Less Code

The essence of this speed improvement is efficiency. We’ve made envisage more efficient in the way it calculates data and displays it. To highlight this, some 5000 lines of code were replaced with about 2000 lines.  Less code means less bugs which is great for everyone!

What does this mean to you?

The scope of this work was a huge undertaking. As an analogy, if envisage was likened to a car, we had to take out the motor, rebuild it, add a turbocharger, test thoroughly to make sure it works, then put it back in.

All while driving down the highway at high speed without stopping!

Yet, although changes like these are significant, you might not notice the difference. Why, then, would we work so hard for an apparent little gain?

Simple. We’re building the best and most robust Growth Management System™ application in the world. We’re helping to create unicorns, who track thousands of statistics everyday. And even if you’re not a unicorn yet, one day you might be. And as you grow on that journey, envisage is ready and capable to grow with you.

Know how to grow with envisage! The world’s first Growth Management System™ Application with Statistics, Org Charts, Objectives, Trends, Events and Reports. Try for free on a no-risk 14-day trial. We’ll even help you set up all your existing statistics to make sure you succeed in getting your business onto Envisage. 

Comment and ask questions below or ask questions privately.

 

Notes

Photo by Tim Mossholder on Unsplash