Memi.Reflection

Private members of memi's thoughts

December 2004 - Posts

XSL Transform performance

I came across few posts regarding the performance of XSL transformation in .NET 1.x, but only yesterday I came across a situation which made that quite clear.

We had an XML file of 1.2MB size, and a quite complicated XSL file (based on WordsheetML) to transform it.

Using the XslTransform object, it took about 10 secs.

Using MSXML4, including all the interop overhead, it took less than a second.

Is that reasonable? Are those the performance I should expect in the following scenarions? Did anybody find a good solution to this problem?

Division by Zero

Is it possible? I didn't think so either. But read this.

I'm working now on a presentation regarding J2EE and .NET. For the sake of the presentation, I wanted to create error on one of the ASP.NET pages (yes, sometimes we do it just for fun. It's not a Bug, it's a Feature, you know...).

So, what is the easiest way to create an exception, I thought to myself? And immediately added the following code to the Page_Load event:

Response.write(1/0)

and executed the code. To my great surprise there was no exception! The page looked just normal. But while examining it more thoroughly, I found the following text on the upper left corner:

אינסוף חיובי

To those of you who can't read Hebrew (and I guess there are a handful of you), the meaning of those words are: Positive infinity.

WHAT? WTF? But wait - that's not all! When I modified the code to:

Response.write(-3/0)

The result was:

אינסוף שלילי

Which is:

Negative infinity.

Now, this is really strange:

First, since when a division by zero results in an infinity? I don't know much about math, but I asked my mother in law, who has a PhD in Mathematics, and she said that an expression like this is undefined, and definitely not infinity.

Second - localized math result? I liked that!

Anyway, here is an article which discusses this issue, but still does not explain when a division by zero is infinity. On the other side, in this article there is a good explanation why <Quote>division by zero is not defined for reals</Quote>, and when it is defined. Well worth reading.

So, does anybody know why division by zero is allowed in .NET?

.NET Deep Dive

Long time no post...

It was a very long silence, but I guess that's what happens when there is so much work that one can't find enough time even to blog a little...

Anyway, a week ago we had the .NET Deep Dive event in Israel. I gave one lecture, about Design Time programming. I think it went pretty well. One of my indicators for a good lecture is the questions you are asked after it. I had tens of questions, face to face and by Email.

BTW, if you would like to express you mind about the event, click here. You'll find here a quick survey regarding this event. Please take your time and fill it. I think it is very important to hear as many as possible opinions about events like this, so we can always improve.

More Posts