﻿<?xml version="1.0" encoding="utf-8"?><rss version="2.0"><channel><title>Ayende @ Rahien</title><link>http://ayende.com</link><description>Ayende @ Rahien</description><copyright>Copyright (C) Ayende Rahien  2004 - 2021 (c) 2026</copyright><ttl>60</ttl><item><title>Sasha Goldshtein commented on The cost of abstraction - Part II</title><description>James,
  
  
I think you've joined the conversation after it's gotten slightly out of context.  I have not suggested that you shouldn't use interfaces because they are bad for performance.  It would be a ridiculous thing to say.  Neither did I suggest that you shouldn't care about "performance in the big" because you care about "performance in the small".
  
  
I care about performance all the way, throughout the entire cycle.  I care about performance when designing my remote interfaces to be chunky instead of chatty; but I also care about performance when choosing the right collection for the job or optimizing object layout.
  
  
Sometimes refactoring for performance is easy, sometimes it's hard.  The same can be said about refactoring in general.  And another point I tried to convey is that sometimes decoupling, dependency injection and other techniques which are good for correctness might not work out just as good as far as performance is concerned.
  
  
Sasha
</description><link>http://ayende.com/3270/the-cost-of-abstraction-part-ii#comment2</link><guid>http://ayende.com/3270/the-cost-of-abstraction-part-ii#comment2</guid><pubDate>Sun, 13 Apr 2008 10:22:21 GMT</pubDate></item><item><title>James Kovacs commented on The cost of abstraction - Part II</title><description>I agree with Oren here. Think about performance in the big:
  
- Are my remote calls chunky enough?
  
- Can I scale out across a farm?
  
- Am I caching enough (or too much) data and do I need to cache at all?
  
- etc.
  
  
Don't worry about performance in the small?
  
- Interfaces vs. abstract base class vs. direct calls
  
- Hand-optimizing sort algorithms
  
- Crazy locking/threading constructs
  
- etc.
  
  
Performance in the big is hard to fix later. You can't just magically make millions of small, chatty remote calls turn into a few dozen. You can almost magically realize that you picked a poor sorting algorithm (based on perf traces) and switch to a more optimal one.
  
  
Let's take Oren's example of interfaces vs. direct calls. If your perf traces indicate that the call through the interface is your bottleneck, how hard is it to change IList&lt;T&gt; to List&lt;T&gt; and create a similar NullList method? I would think 5 minutes on the outside including running your tests. On the other hand, how hard is it to maintain tons of duplicated methods throughout your codebase on the chance that interface calls are too slow? I don't even want to think about it.
  
  
Besides, if you spend all your time thinking about performance in the small, you'll never have time to think about performance in the big - which is where it really matters!
</description><link>http://ayende.com/3270/the-cost-of-abstraction-part-ii#comment1</link><guid>http://ayende.com/3270/the-cost-of-abstraction-part-ii#comment1</guid><pubDate>Sat, 12 Apr 2008 20:57:58 GMT</pubDate></item></channel></rss>