Quick Tip – JavaScript Statement Count Do Count

Saturday, April 20, 2013

Quick Tip – JavaScript Statement Count Do Count One of the things that we as developers don’t seem to mind about is the amount of statements that we write in our code. In JavaScript, the number of statements might affect the speed of the operations we want to perform. It is our responsibility to find statements that should be combined in order to decrease the execution time. This post include some examples of places to decrease the amount of statements. Variable Declarations One of the places that developers don’t care about is declaring variables. Lets look...
no comments

The async and defer Script Attributes in HTML5

Thursday, December 29, 2011

The async and defer Script Attributes in HTML5 One of the rules of thumb that you always hear regarding script elements is to put them very close to the </body> closing tag of the Web page. The main reason for that is that script elements are fetched and executed immediately when the browser encounter them. This default behavior includes blocking the browser’s rendering, loading a JavaScript file into memory, and executing its code immediately. In many circumstances, and in particular when large JavaScript files are involved, this might create a performance bottleneck. One of the solutions...
no comments

Profiling JavaScript 101 Using IE9 Developer Tools

Monday, August 15, 2011

Profiling JavaScript 101 Using IE9 Developer Tools Lately I’m involved in a very interesting project which suffer from JavaScript performance issues in old browsers. The main “pain” in the project is the need to support IE8 which is used by many of the client’s users. I’ve got a call to come and help in the process of tuning the application and decided to share some tips of how I profiled the application and found some of the bottlenecks in the application JavaScript execution. Those bottlenecks were handled by the development team very fast and the application’s execution is becoming much...

Using Javascript to Measure Web Page Performance with IE9

Tuesday, October 5, 2010

Using Javascript to Measure Web Page Performance with IE9 One ability that currently available in IE9 is the new msPerformance javascript object that enables developers to measure real-world performance of websites. In this post I’ll explain what is msPerformance and how you can use it to measure web page performance. The msPerformance Object Wanting a web application that performs great is a very regular and crucial demand in these days. With IE9 beta developers have a new set of javascript profiling API integrated at the DOM’s core – msPerformance object. The msPerformance captures key timing information about the load of the root...
no comments

EFProf – Profiler Tool for Entity Framework

Thursday, August 12, 2010

EFProf – Profiler Tool for Entity Framework One of the important tools in your tool arsenal when you develop with an ORM tool is a profiler. Like SQL profiler to a SQL Server DBA an Entity Framework profiler is a must have tool to Entity Framework developer. The main reasons to acquire such a tool are to understand what is going on underneath the hood in the query engine and for performance tuning. If you think that you can use Entity Framework without knowing what it is committing to...

ASP.NET Output Cache Provider

Sunday, July 18, 2010

ASP.NET Output Cache Provider One of the new features that were shipped with ASP.NET 4 was new providers for caching purpose. In this post I’ll explain one of them – the OutputCacheProvider. OutputCacheProvider Up until ASP.NET 4 the output cache mechanism was implemented as in-memory caching and we couldn’t do nothing to change its behavior. If we desired to use a...

Cache Retrieval Pattern

Sunday, June 13, 2010

Cache Retrieval Pattern In my previous post I wrote about cache layer and its position in every application. In this post I’m going to explain what is the cache retrieval pattern and show an example of how to implement it. Cache Retrieval Pattern When we implement a cache layer we need a strategy in order to retrieve cached items. The cache retrieval pattern is very simple and can be imposed into any application very fast. So how does it work? The business logic component will use the cache API in order to check whether some data exists in the cache. If the...

Cache Layer

Friday, June 11, 2010

Cache Layer Lately I found myself in some architecture consulting sessions at some customers. In every one of those customers I found myself explaining how to implement a cache layer in order to decrease the amount of round trips to the database and for better scalability. In this post I’ll try to explain in high level how to build a cache layer. Deciding to Build a Cache Layer Every application that performance is important to its developers and managers must contain some sort of caching. The cache is a veryfast in memory resources container which holds relevant data close to the application...

Using Stub Entities in Entity Framework Screencasts

Friday, May 14, 2010

Using Stub Entities in Entity Framework Screencasts Today I recorded my first two screencasts (one in English and one in Hebrew) about how to use stub entities in Entity Framework in order to produce better performance by reducing database round trips.  The link to the English version can be found here.  The link to the Hebrew version can be found here.You can also download the screencasts in the details tab if youlike. Enjoy!

CompiledQuery in Entity Framework

Monday, March 1, 2010

CompiledQuery in Entity Framework There are times when we want to make optimizations on some piece of code. If we want to reduce the cost of executing a query in Entity Framework we can use a CompiledQuery to the rescue. Yesterday I used added a compiled query to a code base which was executing multiple times. This reduced the execution time of the repeating queries. In the post I’ll explain what are CompiledQueries and how to use them. CompiledQuery CompiledQueries are a delegate which store a compiled LINQ query that we have built in advance. When we use them we can reduce...