Wednesday, January 5, 2005

441.aspx

.NET Compact Framework performance tips

Scott Holden shares his experience on .NET Compact Framework performance


It covers .NET Compact Framework in particular, but the advices applies to .NET programming in general. I'm happy to see that "keeping it simple", pays off in performance on .NET CF as well since less code is faster code and fewer objects are better for performance.


DataSets haven't improved much since SP2 though, so I'll continue using CSV DataSets when I need to load datasets fast.

Tuesday, January 4, 2005

436.aspx

Is Moore's law the death of Linux?

On the subject of Moore's Law and CPU speeds is Larry Osterman predicting the death of Linux in this decade?



Interestingly (and quite coincidentally) enough, it's possible that this performance wall will effect *nix applications more than it will affect Windows applications (and it will especially effect *nix derivatives that don't have a preemptive kernel and fully asynchronous I/O like current versions of Linux do).  Since threading has been built into Windows from day one, most of the high concurrency application space is already multithreaded.  I'm not sure that that's the case for *nix server applications - for example, applications like the UW IMAP daemon (and other daemons that run under inetd) may have quite a bit of difficulty being ported to a multithreaded environment, since they were designed to be single threaded (other IMAP daemons (like Cyrus) don't have this limitation, btw).  Please note that platforms like Apache don't have this restriction since (as far as I know), Apache fully supports threads.


Will people go back to operating systems specifically designed (or ported over time) to multi processor/thread systems, i.e Windows NT 2k*, Solaris, BeOs?


Mark Russinovich wrote a great comparison of NT/Linux on multi processor systems in 1999 that explains the multi threading problems that Larry mentions in his post. The latest version of Linux has better threading support but in the last tests results I have seen at work we have better performance with Sun JVM on Win2k3 than we have on Linux on identical hardware.

435.aspx

Dr. Dobb's Journal

I used to read Dr. Dobb's Journal a lot when I was studying in Norway and later when I worked in Ireland. Only a few newsagents carry it in Italy so I haven't read it regularly in years. Then I noticed the article on CPU Speed that will be published in Dr. Dobb's soon so I decided to try to subscribe to the Dr. Dobb's. The international subscription costs $50 and includes the new "Windows and .NET edition".


I was getting ready to pay when I found a referene to the "Basic Membership" that is free with the magazine subscription. A few minutes later I stumbled upon the real goldmine:
All Access Membership: $19.95 per year (special limited time offer):



  • 12 months of complete Web access to all available past, current and future issues of Dr. Dobb’s Journal, Software Development magazine and C/C++ Users Journal. (A $99 Value)

  • 12 months of complete access to BYTE.com including ($19.95 value)

  • 12 months of complete access to BYTE Digest ($18.00 value)

  • PDF E-zines and archives from Dr. Dobb's Journal, The Perl Journal and more! ($19.95 value)

  • Topical CD-ROM ISO Downloads ($19.95 value)

  • Michael Abrash's Graphics Programming Black Book, 101 Perl Articles CD-ROM ISO, and more! ($29.95 value)

Some old stuff but a great value for the money. I'm downloading the latest editions now and can't wait to catch up

433.aspx

What happened to the 10 GHz CPU?

Herb Sutter has an interesting article on hitting the speed limit of CPUs that will be published in Dr. Dobb's Journal. Moore's Law applies to the number of transistors on a CPU and continues to be valid (at least for some more time) but we're stuck at 4GHz for a while to come.


Our work just keeps getting more interesting! CPU's will continue to get more powerful as they will add more concurrency capabilities, but sluggish programs will have to be rewritten to take benefit of the hyper threading and multicore CPUs. Adding more threads isn't a free lunch though. As Herb Sutter points out, concurrency has its costs:



  • it's hard to write multi threaded programs. It is very easy to introduce deadlocks or forget to protect variables so you corrupt data under stress. If you always lock everything, you end up with close to single threaded performance. Choosing when, and what, to lock, is a skill acquired with experience (as is good OOP).
  • some applications are difficult to make multi threaded
  • synchronization etc. has its costs

I currently work on the server side (web and infrastructure services), so I'm lucky as I have designed the applications to be multi threaded from the start. Making a server multi threaded is easier, conceptually, than a client application. It's easy to imagine a group of threads managing requests for many clients. It takes a mental shift for most developer to optimize client applications by splitting time consuming tasks, like sorting large lists, among multiple threads. Most developers still have to face the basic concurrency issue in .NET in GUI applications and have a long way before they master concurrency.


I am not worried about server side scaling (yet), as there are plenty of options:



  • Scale out with Windows Load Balancing. This can be used by many applications, not only traditional web applications. Works very well for stateless applications
  • Scale out with Data Partitioning/request routing. Depending on the data the request is routed different set of servers.
  • Scale up by adding more CPUs
  • Asynchronous programming: queue whatever can be queued and execute it later

I particularly agree with this statement:



Efficiency and performance optimization will get more, not less, important


Another thing to keep in mind for those of us with "The holy title of software architect" :-)


Via [Larry Osterman's WebBlog]

Sunday, January 2, 2005

423.aspx

A trip down memory lane

Hiding the Christmas gifts from the kids I found my oldest working PC at my parents place in a closet. Amazing how technology advances in a few years. The monster below was top of the line when I finished my studies:


It is a 33mhz i386 with TWO 120MB hard disks. My iPaq pictured in front of it is more than 10 faster, has more than 10 times as much memory and twice the permanent storage on its SD card! There is no room for the old PC anymore so I slaughtered the machine and took the only things I still have any use for: the 5 1/4 floppy and the HDs with the 5 1/4 bay containers.


I have no idea if the disks still work but I hope they do.  It would be fun to have a look at my thesis, the first program I wrote for a client and the project I have had the most fun (and problems) with. Wonder if I wrote comments in English from the start or if it is something I picked up along the way.


 


 

422.aspx

Best and Worst moments of 2004

Worst moments of 2004:



  • The company my wife worked for was bought by other company. They took over the most important projects and clients and filed for bankruptcy for the company they just bought. The trials still going on.

  • The company I work for was bought by another company. In a way it was sad but I hope it all turns out for the best. I came from Microsoft in 1996 when there was only 15 people working in the company. They stopped development projects due to some bad experiences with small clients just before I started so I ended up doing NT 4.0 migration projects and training. Little by little I got a chance to do some development again, mostly NT services in C++ for the migration projects. Over the years development grew from nothing to a corner stone of a company that passed 300+ employees.

  • Went to the doctor in for a health checkup as I didn't feel too well. The result were bad. I had high blood pressure and the doctor said I had a 'strange sound' in my left lung. It scared the crap out of me, as it would of any ex smoker.

  • Misunderstanding between myself, my wife and the baby sitter about who should pick up the oldest kid from school. Thanks to the teacher for staying 30 min extra!


Best moments of 2004:



 

Saturday, January 1, 2005

419.aspx

Adding the Amazon.com Click to Give link to a .TEXT blog

I found the the Amazon “Click to give“ code on Brian Sullivan's blog. I added his code in Skins\SkinName\Controls\CategoryList.ascx, before the <asp:Repeater tag, to get the link high on the page.


<ItemTemplate>


   <h3>Donate</h3>


    <ul>


        <li>                         


        <!-- Begin Amazon Honor System Paybox -->


            <img src="http://s1.amazon.com/exec/varzea/tipbox/A1J1JDQWBS9GWQ/T3MYIILZNTKFV2"


                  usemap="#T3MYIILZNTKFV2"


                  border="0"


                  alt="Amazon Honor System">


                  <map name="T3MYIILZNTKFV2">


                        <area coords="40,100,160,160"


                              href="http://s1.amazon.com/exec/varzea/pay/T3MYIILZNTKFV2" alt="Click Here to Pay" target=_top>


                        <area


                              coords="23,183,178,195" href="http://s1.amazon.com/exec/varzea/subst/fx/help/how-we-know.html" alt="Learn More" target=_top>


                  </map>


            <!-- End Amazon Honor System Paybox -->


        </li>


    </ul>  


</ItemTemplate>


 


I followed up on my earlier promise and donated to the International Red Cross earlier today.