1

Possible Duplicate:
What is considered fast performance for a single server request?

I'm building a web app and I put a stopwatch in my code behind of a webservice that I anticipate to be heavily used. It basically receives a json record and updates the database. When there are only 2 tables to update/write, the stopwatch read 49ms and when there are 6 tables involved, it runs around 150ms.

[WebMethod(EnableSession = true)]
public string UpdateLead(string Incoming)
{
  Stopwatch sw = new Stopwatch();
  sw.Start();

  ...code here

  sw.Stop();
  return ReturnData;
} 

I know this is is running on my local machine and that it's really just a very limited perspective but I wanted to know if, based on these figures and the given context, the values seem acceptable as they are for now.

Thanks for your input.

Community
  • 1
  • 1
frenchie
  • 51,731
  • 109
  • 304
  • 510
  • I think you mean response times, not request times. And whether they are acceptable or not either is very subjective or requires a lot more info on the case. – The Nail Jan 22 '12 at 20:23
  • See also http://stackoverflow.com/questions/2182207/what-is-considered-fast-performance-for-a-single-server-request – The Nail Jan 22 '12 at 20:24
  • Were you aware that ASMX web services are legacy technology and should not be used for new development? WCF should be used instead. – John Saunders Jan 22 '12 at 20:36
  • @JohnSaunders: yes, but is WCF any faster/better/safer? How much work would be involved in converting asmx to wcf for what tangible benefit? – frenchie Jan 22 '12 at 20:49
  • See [Web Services — WCF vs. Standard](http://stackoverflow.com/questions/6666/web-services-wcf-vs-standard). Also be sure to see [tag:wcf], [How much effort is required to convert an ASMX to WCF web service?](http://stackoverflow.com/questions/1502298/how-much-effort-is-required-to-convert-an-asmx-to-wcf-web-service), and much more at http://stackoverflow.com/questions/tagged/wcf+asmx?sort=votes – John Saunders Jan 23 '12 at 03:01

1 Answers1

0

@frenchie , It is very hard to say . few thing for you to know :

1) the stopwatch values will be different in other enviroment ( production) or maybe if your computer is over-Thinking - which cause him to dumjp some memory to the Swap File (virtual mempoy).

also , if GC is in the middle - your values also will be different.

2) please consider caching (data/ output)

3) try to avoid locks ( which has performance penalties).

4) dont put code in try catch - raising an exception is extremely expensive.

Royi Namir
  • 144,742
  • 138
  • 468
  • 792