"Razii" <wh**********@hotmail.comwrote in message
news:2l********************************@4ax.com...
On Sun, 20 Apr 2008 21:34:03 -0700, "Chris Thomasson"
<cr*****@comcast.netwrote:
>>"Lew" <le*@lewscanon.comwrote in message
news:48******************************@comcast.co m...
>>Chris Thomasson wrote:
This took 15 minutes of my time.
Probably fifteen more minutes than it merited.
Strangely, it crashes with n = 20 with the following flags
cl /O2 /GL /D "NDEBUG" binarytrees2.cpp /link /ltcg
However, it worked with g++....
I know exactly what's causing the delayed shutdown time, and why it crashed.
Apparently, VC++ did not like the static allocator. G++ handled it better,
but it still took a long time to shutdown. Anyway, here is a fix:
http://pastebin.com/m7aca890a
Here is the new times I get:
Java: -server -Xms512m -Xmx512m -XX:NewRatio=1
__________________________________________________ _____
C++: N = 12 / Time: 46 ms
Java: N = 12 / Time: 94 ms
-------------------------------------------------------
C++: N = 13 / Time: 109 ms
Java: N = 13 / Time: 149 ms
-------------------------------------------------------
C++: N = 14 / Time: 281 ms
Java: N = 14 / Time: 297 ms
-------------------------------------------------------
C++: N = 15 / Time: 531 ms
Java: N = 15 / Time: 547 ms
-------------------------------------------------------
C++: N = 16 / Time: 1265 ms
Java: N = 16 / Time: 1078 ms
-------------------------------------------------------
C++: N = 17 / Time: 2140 ms
Java: N = 17 / Time: 1875 ms
-------------------------------------------------------
C++: N = 18 / Time: 4650 ms
Java: N = 18 / Time: 4265 ms
-------------------------------------------------------
C++: N = 19 / Time: 9450 ms
Java: N = 19 / Time: 9109 ms
-------------------------------------------------------
C++: N = 20 / Time: 21671 ms
Java: N = 20 / Time: 23819 ms
-------------------------------------------------------
C++: N = 21 / Time: 42992 ms
Java: N = 21 / Time: 41187 ms
-------------------------------------------------------
The java settings allowed it to complete the N 19 tests. The C++ version
does not have the static allocator anymore, and all the problems related to
it are gone. Can you test this one please? Its going to have a dramatically
faster shutdown time. Thanks Razii.