



Start Walking
Injected Instrumentation
You can do whatever you want in the site to profile the event you want to capture. You can see the instrumented code based on the performance policy injected into the blog site code. AjaxView injects necessary code for performing profiling, logging an send it to AjaxView at the head of the page.
<head profile=”http://gmpg.org/xfn/11″>
<script>
var PageLoadStart = new Date().getTime();
// other var declarations
var emk_OkToSendNextLog = true;
var verbose = false;
function emk_CheckLogs() {
if( emk_LogRecords.length >= emk_MAX_LOG_RECORDS_BEFORE_FLUSH ) {
emk_FlushLogs();
}
}
function emk_FlushLogs() {
// implementation
}
// other functions
</script>
</head>
<!– actual page code –>
Whereever required, it injects the profile code like the following
(tmpCache_emk_LogRecords.push(‘\r\nLM:PerformancePolicy:PerformancePolicy:SCRIPTENTER,’),
tmpCache_emk_LogRecords.push(new Date().getTime()),
During the loading and other execution of your web application, the above profile codes send the log details back to AjaxView using XMLHttpRequest. See the following figure.

AjaxView Console
Getting the Results
Enough logging, now let us see the analyzed results of the logs by opening new tab in FireFox and type http://fakeurl.com/?&AJAXVIEWREQUEST=GET=main.html. This is a fake URL for getting analyzed reports from AjaxView proxy. A two column page will appear. The left side contains the following links:
Our focus in on JS Performance Statistics.
JS Performance Statistics
When clicking on JS Performance Statistics link, JavaScript related performance statistics will appear on the right side. The result is in a three column tabular, with following items:
In my blog web site, http://fakeurl.com//PerformancePolicy/PerformancePolicy/1646706643?&AJAXVIEWREQUEST=LMINFO shows slowest performance of 164 milliseconds. By clicking the file displays another tabular results which contains number of JavaScript functions in the selected page. Meantime (ms) for the function at http://udooz.net/blog/wp-includes/js/jquery/jquery.js?ver=1.2.6 actually shows lowest performance function with line and column details. Here, it is 164 millisecond. By clicking this shows the actual code.
Comparison with IE Development ToolBar Profiler
Let us verify the results with IE Development ToolBar’s JavaScript profiler. The profiler shows the same set of functions with correct count details also. But it varies in the time. The highest maximum time was 109.38 taken by three functions.




Forces
SolutionWe are doing performance engineering of our web based product and now we are more concentrated on client side performance improvements. With the help of available toolset like Fiddler, IE Development Toolbar and some others, it is possible to tweak the code points based on download time and size of the critical ASPX pages. In addition to this, We would like to know the browser rendering or loading time of a behavior, however none of the tools do not provide such clarity. IE Development Toolbar enables to profile JavaScript but in an ad-hoc manner. I was googled various places, and failed to get such tool. I finished my journey at Microsoft Research where I found a tool called “AjaxView”, which enables to inject instrumentation code such as performance profiling, infinite loop detection, etc on the fly even in the production environment by the following nature of web applications:
Thanks to Emre Kiciman and Benjamin Livshits at Microsoft Research for implementing this great tool.
How Does It Works
AjaxView sits between the web server and clients, acts as server-side proxy. It intercepts and rewrites the JavaScript code generated from the web server for a web request by a client. It does not affect the production (or development) environment. See the following figure.

AjaxView Platform

AjaxView Components
AjaxView supports the following broad categories of instrumentation policies:
Let us see a practical walk-through on the next post for better understanding of this tool.
References




Microsoft released Internet Explorer 8.0 a couple of days before. When I installed RC1 months before, I had experienced some page crashes and degrade in performance and usability. The most critical thing was loading “about:Tab” / “about:blank”.
The final release of IE 8.0 is impressed me lot not only for its performance and usability (of course, it is much faster than Chrome), its compliance with the industry standard and moving twoards the semantic web. As a developer, it enables to write our web applications much standard way. In addition to this, the IE 8.0 readiness toolkit enables to add new face to your web application. From the compatibility perspective, it has three different rendering modes:
Let us see the IE 8.0’s new features and standards from developer view point.
Web Standards
CSS Expression has been deprecated in IE 8.0 (standard mode) due to its non-standard CSS extension and performane issue. However, numerous non-CSS 2.1 properties are introduced with “-ms” prefix. The filters also non-standard CSS, so they are now with “-ms” prefix.
<img src=data:image/gif;base64, XyVRKzw0CClkeqva…
AJAX now in HTML 5 Standard
var globalStorage = window.globalStorage["http://www.udooz.net"];
or
var sessionStorage = window.sessionStorage["http://www.udooz.net"];
// to check browser offline
if(!window.navigator.onLine) // do offline behavior
Cross-domain Communication
window.postMessage(“Cross-domain communicated”, “http://www.msn.co.in”);
Visit http://msdn.microsoft.com/en-au/ie/dd433173.aspx#AJAX for more details.
Native JSON Support
IE 8.0 uses douglas crockford’s JSON API, so that you can natively call JSON.stringfy() and JSON.parse() methods.
In addition these, there are so many other features which makes IE 8.0 more near to the semantic web arena. I’ll cover those details in a separate post.




In an alternate to Ajax, or along with it, “Comet” is a server-pushing technology, as we know this as one of the Web Patterns.
Ajax is a technique to asynchronously contact server to get data and update UI (Microsoft calls this as Partial Page Update). In this way of programming, you can get the latest data from the server manually calling the server either by UI events or periodical polling to the server. Assume that your web application has stock market update, in order to get latest update, it needs to poll the server periodically. This will make overhead in both client and server side in one way. For example, assume that there are thousands client periodically polling the server at the same period, however there is no new information/state change in the server. Its an overhead for server.
Comet tries to resolve this by server “broadcasting” state change/new information to the listening clients. Its a king of “Server Push” pattern.


More Options ...
Categories
Tag Cloud
Blog RSS
Comments RSS

Void « Default
Life
Earth
Wind
Water
Fire
Light 