By BoLOBOOLNE payday loans

Abstract Classes vs Interfaces: Performance

Posted: April 29th, 2011 | Filed under: .NET, Programming, Software Development
Author:
No Comments →

Recently I was talking to someone about the benefits of Abstract classes vs. Interfaces and performance came up. The theory being that interfaces are slower because it takes more time to loop through the whole object to find the appropriate method. This was an interesting concept to me. I did some searching around and it turns out that this is a common belief. This CodeProject article makes the same argument. I didn’t set out to win an argument or prove a point as I honestly had no idea which would be faster. In fact I can say that I know so little about the lower level implementation of this that I didn’t even know which I would expect to be faster.

I’m no good with simply taking everyone’s word for it, so I wrote up some basic tests. They aren’t perfect for sure but it gets the job done (download the project), and I see some kind of large divergence in the times depending, I’m guessing, on what else my computer is doing at the time. However the overall trend of the results are consistent. Interfaces are faster until you get to an enormous number of iterations. I didn’t see Interfaces show as consistently slower until I was testing in the realm of 100mil or 1bil iterations, they started to become close enough as makes no difference around 10mil iterations.

Even with the divergence I saw, in the typical application I’m not sure this would play a real role. My approach to this will definitely be to not worry about it unless I am A) working on something where optimization is crucial or B) I start to notice some performance issues specifically related to my abstraction. Chances are that if you have performance issues, whether you are using an abstract class or an interface is not the problem. Of course that’s not to say you should ignore known performance issues, but there are enough non-performance related benefits around abstract classes and interfaces that you shouldn’t sacrifice good design or maintainability for an optimization you’re not likely to ever notice in the real world.

The thing I really wonder about now is if it’s a product of the CLR. If I get to it, I may write a similar test in java and post the results.

Tags: , , ,

Lightning Strikes, no seriously…

Posted: April 27th, 2011 | Filed under: Events
Author:
No Comments →

My house was hit by a nasty bolt of lightning last night. It fried my cable modem, my router and at least the motherboard of my computer. No fun at all. But I thought it would be fun to show what the cat5 cable running from the modem to the router looks like…

Network cable after Lightning

Cool eh?

Tags: ,

A few weeks with Windows Phone

Posted: April 12th, 2011 | Filed under: Technology
Author:
No Comments →

Over the last few months my iPhone had been falling apart. I couldn’t really put it to sleep anymore. My battery was becoming just shy of useless. I needed a new phone. I’ve been feeling pretty burned out on Smart phones all around. I wasn’t sure they were really doing that much for me, so I was even questioning getting a smart phone all around. I decided to see what Android was offering though, figuring that I would be going that way, if I got another smart phone at all. Then a friend suggested I take a look at the new Windows Phone 7 (WP7). I figured why not, while at the store checking out whatever the latest android offerings were I asked to check out whatever they had for Windows Phones.

I have to be honest, it took me less than a minute with an Android phone in one hand and the Windows Phone in the other to realize if I got a smart phone it was going to be Windows based. It’s not the popular thing to like Windows. Especially coming off of an iPhone, but to be honest, the UI is gorgeous. It’s just a pleasure. It made my iPhone UI feel like the old gal at the bar. You know the one, she’s sitting off in the corner with too much make up and dark lighting that hides her wrinkles. The Windows Phone made Android feel like Linux did 15 years ago, unpolished and a little cumbersome. The Metro UI is right up my alley. Lots of Type faces as design, minimalism. They opted for clean and simple where everyone else is being flashier. I love it.

This was a strange revelation to me. I had almost completely decided that I wanted Android if I had another smart phone. The only competition to that I could see was going to be one of the Palm devices. WebOS gets nothing but praise even if the hardware isn’t the best. I’ve used it and it’s great to use. There’s little doubt to me that, as an OS purely, it’s better than iOS, Android and probably WP7. Too bad the hardware sucks, there’s not much as far as apps and it’s under HP’s hand now. Anyway, as I sat there using this WP7 I was loving it more and more and then realized that Microsoft must be subsidizing it big time because the phones were cheap. For a comparable device I was looking at paying around 50% less for WP7.

So I went for it. My geek cred on the line, I decided to take the dive with a Windows Phone and see where it took me.

Read the rest of this entry »

Tags: , , , , ,