title: Web api performance?
body: <p>I was thinking , </p>
  
  <p>The  <code>WebApi</code> along with <code>routing mechanism</code>  works in such way that it reads the <code>http verb</code> ( GET POST etc...) and then searches for matched method names / parameters : </p>
  
  <p>For example : </p>
  
  <ul>
  <li><p>If it's <code>GET</code>  and the URI is <code>api/Customers/5</code>: </p>
  
  <ul>
  <li><p>method should start with <code>Get</code></p></li>
  <li><p>if it has <code>ID</code> so search a method which accepts int as  parameter.</p></li>
  <li><p>etc. (there are more rules).</p></li>
  </ul></li>
  </ul>
  
  <p>I mostly believe they did it using reflection.</p>
  
  <p><strong>Question :</strong> </p>
  
  <p>Isn't it a performance hit , for every URI request - to search all this data just to attach a method ? </p>
  
  <p>Where I could easily send a very short string from a client which will imply on the method on the server side ? </p>
  
  <p><em>Why not doing it the simple way ? Ok cause we want to use http verbs as meaning. OK. but so much operations just to execute a method</em></p>
  
  <p><strong>example #1</strong></p>
  
  <p><code>get api/Customers/5</code></p>
  
  <p>could be </p>
  
  <p><code>a.ashx?m=gc&amp;id=5 (method=GetCustomer  &amp; id=5)</code></p>
  
  <p><strong>example #2</strong></p>
  
  <p><code>put api/Customers/5?v=123</code></p>
  
  <p>could be </p>
  
  <p><code>a.ashx?m=uc&amp;id=5?v=123' (method=UpdateCustomer  &amp; id=5 &amp; value=123)</code></p>
  
  <p>mine is even shorter.</p>
  
  <p>Dont get me wrong. I believe this api was done by very smart people who knew what they talk about.</p>
  
  <p>Just want o know what am I missing.</p>