Just sharing some of my inconsequential lunch conversations with you... RSS  

Wednesday, December 05, 2007

Quantifying the Performance of Garbage Collection vs. Explicit Memory Management

I thought this was a discussion we already had in the past, on which our option is already made. Nevertheless, here's a nice post about it.

Conciliating Windows and Linux

A good friend and colleague of mine - lets call him 'Mister M' - just hates Windows. As we only work on Windows, 'Mister M' lives a miserable life on our office, always complaining about how Windows sucks, opposed to his preferred Linux. If you're reading this post on my blog, I got his permission to post.

6 months ago, after installing a UMTS card, 'Mister M's laptop started freezing every now and then, making 'Mister M' love Windows even less. I've asked him why didn't he installed a Linux? He was afraid loosing his 'corporate' Windows installation, packed with Outlook, an ERP client, a CRM client and some LOB applications. I then asked him why didn't he virtualized his Windows installation?

After 6 months of recurring freezes and some of my 'peer pressure' he just did it! Here's what we did:

  1. Used VMWare Converter to get his Windows 'corporate' installation into another box;
  2. Made sure his Windows 'corporate' installation worked fine;
  3. Installed an Ubuntu 7.10;
  4. Installed VMWare player on Ubuntu;
  5. Copied his Windows 'corporate' installation image back into his laptop;
Et voilá! He now has the best of both worlds. And better yet, he will (hopefully) stop nagging me about how unstable his Windows is!

I would like to do it on a Mac OS X, not because Mac OS is a better OS, but because I believe that we can learn a lot about how diversity can help us looking out for better solutions.

This pattern is an interesting one, but doesn't stop here: in a near future, desktop OSs will most probably run over a thin hipervisor, guaranteeing the isolation, maintenance performance and parallelization of several OSs.

PS: while installing Ubuntu he still nagged about how Windows would made him restart after software update. I've told him Ubuntu would also do it. As it did :)

Microsoft has killed Santa Claus

Yeap, seems like they have done it again :) Microsoft's new artificial intelligence-powered Santa bot is subjecting the world's children to, how does the article states, an unprecendented torrent of filth? (Guys, you British are just too much. Apart from the kids access, were I come from we wouldn't call it filth....)

Here's a transcript:

El Reg says: pizza (pi)

Santa says: Yum! What do you want for Christmas, El Reg?

El Reg says: Maybe you shouldn't eat so much! You are quite large!

Santa says: My elves will get right on that. And what else are you wishing for this year, El Reg?

El Reg says: Maybe you shouldn't eat it?

Santa says: See if you can get someone else to eat it!

El Reg says: Eat it

Santa says: No thank you. I don't eat things!

El Reg says: Eat it

Santa says: See if you can get someone else to eat it!

El Reg says: Eat it

Santa says: You want me to eat what?!? It's fun to talk about oral sex, but I want to chat about something else...

El Reg says: You dirty bastard!

Santa says: I think you're dirty bastard.


Is Microsoft trying to rewrite the Turing Test to the capability to demonstrate other human characteristics? :) Are Microsoft developers immature pranksters? Are they just trying to get attention to their bot? Are they trying to get just another lawsuit? Or making this exercise of a Turing Test is just darn hard?

[update]
Seems like Microsoft has started re-educating their bot. Here's my favorite one - aimed at theregister.co.uk or the British in general?

Call Santa a "dirty bastard" now and he'll say: "Merry Christmas, especially to all my friends in the UK!"

Cool!

Tuesday, December 04, 2007

ReadyBoost Performance Test

I was looking for a USB stick that was compatible with ReadyBoost when I ran into this article:

If you have an unused flash drive, plug it in and set it up for ReadyBoost. It won’t hurt. If you have a computer with a WEI disk rating of less than 4.0, adding a ReadyBoost flash drive offers good bang-for-the-buck. If you have a computer with a WEI disk rating of more than 5.0, ReadyBoost still won’t hurt, but it probably won’t give you a noticable improvement.
Well, I have a 7200 RPM disk with a rating of 5.2, so my system is clearly not a candidate for ReadyBoost. Perhaps on a laptop:
Lexar JumpDrive 1GB. This drive reduced startup time by 30% in the older Dell D600 laptop, from 59.3 seconds to 39.8 seconds. This laptop has a slow (4500 RPM) hard disk.
People with slow disks, here an opportunity to boost you Vista experience.

Windows XP SP3 RC1

Here it is, for MSDN subscribers: download. Just installed - no much difference found yet.

Free Training: Visual Studio 2008 Training Kit

Robert Shelton just announced:

Microsoft recently released a freely downloadable training kit, with presentations, hands-on labs, and demonstrations, of pretty much every feature in Visual Studio 2008.

It covers:

  • LINQ,
  • C# 3.0
  • Visual Basic (.NET) 9.0
  • Windows Communication Foundation (WCF)
  • Windows Workflow Foundation (WF)
  • Windows Presentation Foundation (WPF)
  • ASP.NET AJAX
  • Visual Studio Tools for Office (VSTO), this is where the SharePoint Development stuff is!
  • CardSpace
  • SilverLight
  • Mobile
  • Application Lifecycle Management (ALM)

Here's the download link: Click here




SQL Server 2008 Filestream

This is a long awaited feature! SQL Server 2008 introduced a filestream option that can be applied to a varbinary(max) column, mapping it into the FS!

Here's how:

CREATE DATABASE AdventureWorksRacing ON PRIMARY
( NAME = AdventureWorksRacing_data,
FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\AdventureWorksRacing_data.mdf',
SIZE = 2MB,
MAXSIZE = 50MB,
FILEGROWTH = 15%),
FILEGROUP FileStreamGroup1 CONTAINS FILESTREAM
( NAME = AdventureWorksRacing_media,
FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\AdventureWorksRacing_media')
LOG ON
( NAME = AdventureWorksRacing_log,
FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\AdventureWorksRacing_log.mdf',
SIZE = 5MB,
MAXSIZE = 25MB,
FILEGROWTH = 5MB);
GO

CREATE TABLE [dbo].[eventMedia] (
[mediaId] [uniqueidentifier] NOT NULL ROWGUIDCOL PRIMARY KEY,
[dateCreated] [datetime] NOT NULL DEFAULT(GETDATE()),
[createdBy] [nvarchar](256) NOT NULL,
[fileName] [nvarchar](256) NOT NULL,
[mediaType] [nvarchar](256) NOT NULL,
[location] [geometry] NULL,
[file] [varbinary](max) FILESTREAM);
GO;


And there you go, upon insertions on this table, the corresponding files will appear on C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\AdventureWorksRacing_media. It's a kind of magic...


Heard about it at infoq

Windows 2008: another flop?

Is there a trend in here? Bink.nu reports:

Research indicates that Windows Server 2008 could be just as big a flop in the enterprise as Windows Vista. In a survey of 687 IT professionals conducted by Network World, half of them said that they have no plans whatsoever to upgrade to Windows Server 2008 at any time after it launches in February.

Come on, you people, new OSs are fun! Arghh, borring... Looks like the end of Moore's Law is passing on to people...

User Experience: should user be asked about everything?

Let me give you some examples:

  • Mac OS: (most of) the settings just don't ask for confirmation (neither 'apply' nor 'cancel');
  • Windows Vista: stand-by button doesn't ask for confirmation; neither the rest of the session options, including shutdown;
  • OneNote: no confirmation either;
  • Windows Mobile: same here;

The fact is this seems to annoy a lot of people I know. To be honest, at first this 'no confirmation' pattern seemed a little dangerous. Now that I'm used to them it makes perfect sense.

We are somehow used to be ask a lot of confirmation messages, and this makes us feel safe. But confirmation messages are annoying by themselves, and quite cumbersome on some occasions.

What do you think about these confirmation messages?

Amdahl’s Law

Amdahl’s Law in plain terms: the maximum achievable parallel speedup is limited by the amount of sequential code remaining. This makes sense: at some point, even with an infinite number of processors, the only work remaining is the sequential code: and its performance is limited by serial execution.

Taken from the 'Parallel Extensions to the .NET Framework' help, in 'Performance Tips': have realistic expectations!

Here are the tips:

  1. Target areas of your program where algorithms are computationally expensive and/or data sets are large (e.g. > 1000 elements). In such cases, there will likely be benefit to using parallelism.

  2. Parallelize outer loops, not inner loops. So, in this example:
              foreach (var c in customers)
    {
    var q = from s in sales
    where s.CustomerName = c.Name
    select s.Units * s.Produce.Price;
    c.Total = q.Sum();
    }
    It is often better to parallelize the outer foreach loop rather than the inner query:
              Parallel.ForEach(customers, c =>
    {
    var q = from s in sales
    where s.CustomerName = c.Name
    select s.Units * s.Produce.Price;
    c.Total = q.Sum();
    });
    Of course, there are exceptions such as with the following:
              for(int i=0; i<2; i++)
    for(int j=0; j=<1000000; j++) { ... }
    On a dual core, parallelizing the outer loop may be fine (if the inner loop doesn’t block), but on an 8-way just parallelizing the outer loop won't scale better than 2x due to the restriction on the outer loop's size. In such a case, it’s better to parallelize the inner, or both.

  3. Avoid requiring ordering where possible in PLINQ, either by explicitly turning off order preservation (off is the default) and avoiding operators that add ordering expectations. This leads to performance slow-downs. See the Ordering expectations section in the Parallelism Blockers topic for more information.

  4. Prefer having independent loop iterations and Task bodies to using synchronization. Adding synchronization to the bodies of parallel work will affect the scalability. In some cases, this is unavoidable in order to achieve correctness.

  5. Be conscious about the number of Tasks created explicitly. Although Tasks are lightweight, creating one incurs a few object allocations and some synchronization necessary to enqueue the Task into the scheduler’s queue. There are some examples in the documentation that show divide-and-conquer, recursive creation of Tasks. And in those examples, we’ve seen that at some point the overhead of Task object allocation may dominate the recursive algorithm in question.

  6. f. And lastly, the least technical advice of all of these: Have realistic expectations. There is a phenomenon known as Amdahl’s Law, which states (in plain terms) that the maximum achievable parallel speedup is limited by the amount of sequential code remaining. This makes sense: at some point, even with an infinite number of processors, the only work remaining is the sequential code: and its performance is limited by serial execution.

Monday, December 03, 2007

WD Elements 500GB External Hard Drive

Elements External 500GB Hard Drive
RPM: 7200
Cache: 8MB
Interface: USB 2.0



Just bought this inexpensive external USB hard drive. It's a fair unit for the price. Here's my review:

Pros

  • silent
  • convenient rubber grips
  • cheap (99€)

Cons
  • Lack of technical data (neither RPM nor cache)
  • 8MB Cache

HD Tach just refused to run on Vista, so I had to turn the compatibility mode (to the default, XP SP2, if I remember correctly). Read a consistent 33MB/s sequential read.

ASP.NET MVC Framework (Part 2): URL Routing

Guthrie again, yes, I know. Here's the link - for history reason only :)

Development Catharsis :: Copyright 2006 Mário Romano