Web Dev Matters and Me

Web Development Matters - HTML, XML, C#, .NET, AJAX/Javascript(jQuery), CSS, XML-XSLT

ME - LIFE,Philippines, Tokyo, ECE, PhilNITS/JITSE,情報処理, 日本語

things about Philippines, gaming, C# development and web development, how to make money in stock trading

Web Dev Matters and Me

C# Code Optimizations

Today, I asked few developers from a forum(S.O) about some conversion. On my post, I said my need to get the data by performing bit shifts instead of divisions. Though, most of the people there suggested that it is not something that can improve optimization, I strongly disagree.


So, to make an experiment.. how about trying to make two Stopwatch objects ..
on the method that will be executed, initialize an instance, then invoke the Start method. just below that have a loop that performs 10000 times and inside this loop, perform a multiply operation.

After it exits the loop, invoke the Stop method.

then, on the next line, initialize the second Stopwatch object, invoke the start method and have a loop that performs 10000 times and inside this loop, perform a division operation.

after it exits the loop, invoke the Stop method of this object as well...


You can see the difference by checking on the ElapsedTicks of the Stopwatch objects.. I'm sure you now know what I'm talking about (^_^)



Getting reference to Controls in Lightswitch

While trying something in Lightswitch, we encountered a problem that involves using different controls (non-default), like Textbox,Stackpanels, etc. Now, the problem is, the data that will be displayed using those custom controls are not really part of the actual data model.

To Cache or Not To Cache - ASP.NET

I've recently implemented caching on some pages of my website. But it seems that caching won't help much because it is hosted on a shared server. While the page will be optimized using the cache, it can also be a reason to hit a 503 very soon, especially if caching is implemented with varying parameters.


But when should we use caching? I think caching can only solve scenarios to lessen the delay of serving resources to client browsers, instead of having a direct query to resources per request.

For example, I need to display data from database that takes about 1-2 minute query. This data can just be cached to have it served right away. But also, we should keep in mind that, if we put this on cache, we are putting these on memory..... and these memory takes a portion of the application pool's resource.

So, it is important to consider what to cache, and if the server (app pool) can cache.

FB Connect