1. Why x64 app runs slower than x86 app ?
I have played with Parallel Extensions and noticed to my surprise that
executable compiled for x64 runs slower than compiled for x86:
private static double HeavyMath( int I )
{
double D1 = Math.Sqrt( I ) * Math.Pow( I, Math.PI ) * Math.Pow( I, 1 /
Math.E );
double D2 = Math.Sqrt( I ) / Math.Pow( I, Math.PI ) / Math.Pow( I, 1 /
Math.E );
return D1 / D2 + D2 / D1;
}
private static double Sequential( int N )
{
double R = 0;
for ( int I = 1; I <= N; I++ )
{
double D = HeavyMath( I );
R += D;
}
return R;
}
private static object lockThis = new object();
private static double Parallel1( int N )
{
double R = 0;
Parallel.For( 1, N + 1,
I =>
{
double D = HeavyMath( I );
lock ( lockThis )
{
R += D;
}
}
);
return R;
}
private static void CallMethod( Func<int, double> M )
{
Stopwatch SW;
double D;
const int N = 20000000;
SW = Stopwatch.StartNew();
D = M( N );
SW.Stop();
Console.WriteLine( "{0}: {1:F0}", M.Method.Name, D );
Console.WriteLine( "{0}: {1} ms", M.Method.Name,
SW.ElapsedMilliseconds );
}
static void Main( string[] args )
{
CallMethod( Sequential );
CallMethod( Parallel1 );
}
Sequential method takes ~11,2 sec if compiled for x64, but only ~9,8 sec if
compiled for x86.
Parallel1 method takes ~7,1 sec if compiled for x64, but only ~6,7 sec if
compiled for x86.
Environment is VS2008, Vista Ultimate 64-bit, Core 2 Duo 2.40 GHz.
Are such times result from use of double arithmetic ?
Or what else ?
Oleg Subachev
2. Run WinForms app as Console app - CSharp/C#
3. C++ App to Run in DOS and Launch Another App
I have a problem that I can't seem to solve: I need to write a C++ app that will run off of a floppy. Basically, I will boot into DOS (from a floppy), and run my executable from the floppy. The executable will crunch some data and then launch another application. How can I launch the other application? I've tried system(), but it needs a specific path, which isn't viable in DOS mode. The two apps will be in the same directory, so basically this is the process: CrunchData(); LaunchApp(); How could I launch the other app? I don't think ShellExecute() or the Process class will work since this will be running in DOS, but I may be wrong. Thanks so much.
4. Security exception -- running assembly from a shared directory - CSharp/C#
5. dll dependency cannot be copied to the run directory error
Hi, I got an application which incorporate many other dll controls. When I integrated the builds from other person, I get this error all over the place Error: The dependency 'MyDAL, Version 1.0.2482.21839, Culture=neutral' in project 'Controller' cannot be copied to the run directory because it would conflict with dependency 'MyDAL, Version=1.0.2475.19815, Culture=neutral. I got many more of these when adding the new MyDAL project to my application. How do I fix this? Thanks
6. Get Directory of Running Executable - CSharp/C#
7. Deploying VC 7.1 run time DLLs to the system directory
8. Set ASPNET Version for Virtual Directory from C# App - Asp.Net