Inside Chronon 3 Recorder: How we achieved the magical speed boost
We released Chronon 3 last week with an order of magnitude performance improvement. Let’s take a look under the hood to see what makes it all tick!
The Recipe
Once your program is running, it keeps monitoring it against the initial set of predictions. If the execution at any time differs from what was 'predicted':
1. The prediction data structure is modified to take into account the new information.
2. Recording data is generated to select the right 'prediction' from the structure. This usually takes only 1 to 4 bits.
3. If the prediction matches accurately though then no data is generated at all!
See it in Action
For example, consider the code below:
Assume there are 2 threads that call the method process().
The first thread has an object of type Foo and calls Foo.bar(), which matches the prediction made by the recorder exactly, so no data is generated at that point for that thread.
The second thread calls has an object of FooSub instead, and thus ends up calling FooSub.bar().
Now here is where things get interesting. For this thread only, the prediction structure is adjusted to account for this new method call. Then a single bit is stored to select the right method call from the prediction structure. The previous thread, on the other hand, which keeps Foo.bar() keeps generating no data as its prediction is accurately matched.
Results
As you can see that the new prediction mechanism helps in saving a ton of data that would otherwise have been generated and even when data is indeed generated, it’s only very minimal. Apart from the example given above, we have a whole bunch of predictions inside the Chronon 3 Recorder. We now even have a pluggable architecture where we can keep plugging in more of these predictions and constantly increasing the speed of the recorder, without needing to wait an entire year.
So far the current architecture has worked extremely well and almost all our previous users running into OutOfMemory issues are now able to record easily!
Simplifying chrononsystems.com
As we get all set to release Chronon 3, we noticed that some elements of our website were causing confusing among our visitors, thus we decided to update it. Below is the description of what we changed and why we did so.
What has changed
The changes we made really boil down to the 2 most visited links on the header menu of the website: 'Pricing' and 'Download'.
The change we have made is that we have removed those links from the header menu.
Why remove links from the header menu?
Now, you are probably thinking why would we remove what are probably the most visited and important pages of the website!?
Well, first of, rest assured, the pages still do exist, they have just been moved around to a more appropriate location. Details are as follows:
As it turns out, when we launched last year with our first product, the Chronon Time Travelling Debugger, we were a single product company, so it made sense to have a single pricing page and a single download page. It caused no confusion whatsoever for the visitors since they got exactly what they were looking for.
However, fast forward to now, we have multiple products, 3 in fact:
We even branded the 'solution' we offer as a combination of these products as 'DVR for Java' and came up with a brand new redesign and look and feel of the website in October 2011.
As it turns out, the redesign was an evolution of the structure of the previous website. Thus, although it had a 'Products' menu, allowing you to view each product, it still had a single 'Pricing' and 'Download' page. And this led to a ton of confusion for the visitors.
Confusions Abound
For example, here is the previous 'Download' page:
However, a lot of visitors to the site who came because they heard of the the Time Travelling Debugger, when they clicked the Download link, and saw a download button for the Recording Server, it got them utterly confused.
In fact, we received so many support mails on that, that we actually had to put a section on the side which literally said 'What is the Chronon Recording Server', along with the links to the Product Overview page to explain that we have multiple products.
A clickmap of the download page showed that these links were indeed being visited by a lot of users and thus provided us with more evidence that there was a ton of confusion.
The new changes
So to simplify things, we have removed the single page 'Download' and 'Pricing' from the top menu bar and placed 'Download' and 'Buy' buttons on the pages of each product.
This way there is no confusion, if you are on the Time Travelling Debugger product page and click on the 'Download' or 'Buy' button, you don't see the Recording Server. Same with the Recording Server buttons.
We hope this change will simplify things a lot for our visitors.
More to come....
We are still working on making continuous improvements to the website as we go along and in the spirit of the 'Engineering Chronon' blog, we will keep you informed of the changes and the rational behind those changes.
Using Mindmaps for design
I recently came across Mind maps.
I find them to be excellent for designing/architecting. Much better than a design document with bullet points and long descriptions.
If you think about it, take any problem, you usually end up first breaking down the high level concepts, then working your way down to the details of each in a hierarchical manner. Mind maps allow that naturally, and I have found them better than anything else to put thoughts on paper.
Below is a mind map showing the design of the 'Open External Recording' dialog in Chronon.
Notice how easy it is to see each case and go all the way down to the minute implementation details of each. It is much more consice that a long design document and conveys the information much more clearly.