Saturday, March 19, 2011

Mobile Device Detector - Performance

The last blog post about Mobile Device Detector was so popular, that I've decided to post updates and some results of performance profiling without delays.




Mobile Device Detector has been updated and now supports few more conditions:
  • Pointing method
  • Device OS
  • JavaScript Support
  • Cookie Support
Also, the code was re-factored, in order to be more compatible with future CMS releases.

Regarding the performance testing - I did not try to cover all cases, just a few simple scenarios and basic tools. The following tools were used:
  • jMeter
  • ANTS Performance Profiler
I've measured average(per 2000 requests) response time(ms) with different number of threads and using the same / unique user agent string.
The results are quite interesting:


There is almost no difference in response time when you enable Mobile Device Detector. Looks like detection takes about 1-2ms.

In order to confirm these results, I've performed profiling using ANTS profiler and jMeter:

1. Single thread, same UserAgent:


2. Single thread, random UserAgent:


3. 5 threads, same UserAgent:


4. 5 threads, random UserAgent:


Handling 2000 requests usually takes 2 seconds of CPU time, or ~1ms per request, including Sitecore device resolving logic.


I think these numbers are just fine. There is no sense to compare them directly to the ones found on internet, as the hardware varies a lot(this test was performed at the rather old desktop with 2.13Ghz Intel CPU and DDR2 RAM). Just test(using jMeter, etc) Mobile Device Detector with your solution and see how it affects performance. It would be great if you can share the results.