I am working on building a .NET-Based web service where I pass in a string as part of the URL, and I return another string. The returned string is actually JavaScript.
Currently, I am using MVC3 for this service, because the requirements seemed very simple, and I did not see any reason to bring WCF into it. -Especially since I am just returning JS, and don’t need any data wrapped up in XML or anything.
During initial load testing, the performance of the service seemed to be unacceptable (throughput of about 85/second). Since I am building JavaScript on-the-fly, and returning it, I decided to see what the performance would be if I simply returned some hard-coded JS. This doubled my performance (throughput of about 175/second). Nothing earth shattering, but it was about twice as fast. I expected this.
Then, for fun I decided to see how fast it would be to load test just pulling actual pre-generated JS files from IIS. This blew my mind. It was about 30 times faster (throughput of 2,200/second)! I expected pulling flat-files to be much faster than generating JS and then returning it, but this is so much faster, I am wondering if MVC3 is very slow, or if there is a problem with the server.
If I switch to WCF, will I see a significant throughput increase? Will WCF even let me return a string of JS (or does it expect everythigng to be wrapped up in XML)? If I need very fast response times, should I be using something besides WCF or MVC3?
Thanks
As I stated previously,
Pulling the files from iis is a completely different operation and allows extreme performance gains because of server file caching and no processing required. I don’t think your wcf will be that different (yes you can return JavaScript) but it would be a simple perf test.