mono/mono — pull request #302 by konrad-kruczynski (2012-05-24 21:56:19+00:00)
Title: Double <-> Int64 conversion is much faster now.

Instead of using GetBytes and converting bytes to long, which involves allocation and deallocation of small temporary array, the simple cpu register load is in fact done now. This results in a much faster operation.

With this sample program:
```csharp
var stopwatch = Stopwatch.StartNew();
var sum = 0L;
for(var i = 0; i < 100000000; i++)
{
sum += BitConverter.DoubleToInt64Bits(99.9);
}
stopwatch.Stop();
Console.WriteLine(stopwatch.Elapsed);
```
my results are:

* **00:00:00.6614282** with my patch;
* **00:00:19.8135516** without my patch and Boehm GC;
* **00:00:10.2296766** without my patch and SGEN GC.

I'm doing a lot of this operations in my serialization framework, so it is quite essential to be fast ;) The performance improvement is due to no-allocation nature of the patch vs the old code, which allocated a temporary array (difference between Boehm and SGEN is explained the same way).