|
I changed int with long.
I got the same result.
|
|
|
|
|
Another possibility (that I haven't checked): Does the .NET 2005 version you are using contain debug code, while the .NET 2003 version does not?
John
"You said a whole sentence with no words in it, and I understood you!" -- my wife as she cries about slowly becoming a geek.
|
|
|
|
|
|
You realize that I was referring to the framework itself, and not your code?
John
"You said a whole sentence with no words in it, and I understood you!" -- my wife as she cries about slowly becoming a geek.
|
|
|
|
|
Just to make things a little more confusing. In the Release version or youre code, you're only doing one math problem at runtime. The optimizer will evaluate the math of 2 constant values into a resultant constant and substitute that constant for the code used to get it.
You're actually just mov'ing two float64 constants to the two locations a and b. Then the division takes place and is assigned to c as a float64 result.
You're code is actually this:
for(int x = 0; x < 100000000; x++)
{
double a = 1524157.8750190521
double b = 152415787.50190521
double c = a / b;
}
But, that's not the problem. The problem is that your still running under a 32-bit OS. You can't use any of the 64-bit instruction set, including math instructions, until you replace your OS with Win64 enabled Windows. Until then, your doing 64-bit math using only the 32-bit instruction set, which, oddly enough, is slower on the 64-bit chips.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
OS is Windows Server 2003
Enterprise x64 Edition
Service Pack1
|
|
|
|
|
Then I have no idea what's causing it.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Well, other than the .NET Framework 2.0 is still a beta and not optimised for performance benchmarks yet.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
My best guess is that .NET 2005 is beta still. Try this again in November when it's RTM.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Cops & Robbers
Judah Himango
|
|
|
|
|
I am calling a dll from C#.
The dll is called from a single function call in C# (dllimport ...)
The dll produces data, which I want to access in real-time as and when it is generated in C#. However, the single function call will obviously only return the final answer.
How can I setup either the dll or the C# to give me data as I require? Do I need to make an additional function call in C# that gives me access to the data or will the dll have to setup to send data back periodically? If so, how can I do this?
Your help is appreciated.
-- modified at 12:30 Tuesday 6th September, 2005
|
|
|
|
|
Let me ask if I'm understanding your problem correctly. Your C/C++ dll produces data in real-time, but only gives the final result back, yet you want your C# code to have access to the real-time data? If that's what you want, then you have a few options. One option is to split up the C/C++ function into several functions, each returing parts of the real-time data. Another option is to pass a delegate type to the C/C++ dll which will be called from inside the C/C++ dll as it receives real-time data. I'd recommend the latter option.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Cops & Robbers
Judah Himango
|
|
|
|
|
Hi,
Yes that's what I'm trying to do. The dll is written in Fortran so splitting up the routines is definitely not something I want to do.
I was half-expecting the answer to be on multithreading whereby a call would be made to the main process and periodically a call would be made to the fortran routine that keeps the data with a flag so tell C# that new data has arrived.
Just for interest, would this be a good idea?
However, I will try as you suggest.
|
|
|
|
|
|
Hi folks,
I'm unable to convert code that works in MFC for Pocket PC (2003 using VisualStudio 2005 beta 2) to C#. The basic idea is to use the COM object for Pocket Internet Explorer to gain access to the HTMLDocument object.
In MFC this is done in the view class with something like (error handling removed for brevity)
m_wndBrowser.CreateControl(CLSID_Browser,
lpszWindowName,
WS_VISIBLE | WS_CHILD,
rectClient, this,
AFX_IDW_PANE_FIRST);
LPUNKNOWN lpUnk = m_wndBrowser.GetControlUnknown();
lpUnk->QueryInterface(IID_IBrowser, (void**) &m_pBrowserApp);
lpUnk->QueryInterface(IID_IBrowser2, (void**) &m_pBrowser2App);
...
But how to that in C# ? I checked MSDN (which directed me to use the Type Library Importer, but on what ? there is tlb or dll for PIE) and google but without success.
regards,
Tom
|
|
|
|
|
i need a long Image array of [300] images of 900x1100 pixel
i made it and it works...
but the access of it is slow in my application when i push a button i just use 5 images of this array and make just some modification, draw some line cut a part of the first, a part of the second and put all together.
It works slow becouse i use GDI+.
How can make it to works faster?
Can i use some faster memory area of my pc?
|
|
|
|
|
Loading 300 images, each 900x1100 in dimensions is gonna kill your memory usage. There's just no way to do this on a desktop PC, memory will shoot through the roof, dragging your system to a crawl.
So my first suggestion, don't load all 300 images into memory. Load the images you need, and call Dispose() on them when you're done. This should improve your performance (and memory usage) quite a bit.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Cops & Robbers
Judah Himango
|
|
|
|
|
IF you're using 32bit color that's ~1.2gigs of data. Between application and OS level overhead, you'll probabably need at least 1.5gig of ram to keep the entire working set in memory at once. If your application needs to run on more modest machines you'll need to redesign your architecture to only load a fraction of the images at a given time. You could try storing the data in memory in a compressed format and only expanding the images as needed, you'll still have a fairly large ammount of overhead, but if you need the entire collection in working memory at once it would probably be better than thrashing the swapfile.
|
|
|
|
|
Hello
If you are trying to perform some image processing routines, then you should use LockBits and process your image using unsafe mode. It will be much faster, then using SetPixel /GetPixel .
But, as it was already said here, you need to avoid loading all 300 images. Even with unsafe mode it will be rather slow, because you will need much memory. And if you have no such much memory, then will lose performance on memory swapping.
With best regards,
Andrew
|
|
|
|
|
I am facing a problem with DirectPlay in C# is that
I want to simulate half duplex voice chating. Like whenever a person want to
talk, it press a button "Push to Talk". So, all other persons listen like in conference room. It means only one person can talk at one time. If someone press the button "Push to talk" while another talking, voice quality should be degrade.
Can i do this with TCPClient / TCPListener classses. If yes, how i can get audio stream from TCPClient object and how i playback.
Thanks Thanks Thanks in advance. Please help me urgently
Zeeshan
|
|
|
|
|
I'm a little fuzzy on this. How do I get a saved filed to display the same Icon/image as the application?
Thank you for you responses.
Jerry
"Art doesn't want to be familiar. It wants to astonish us. Or, in some cases, to enrage us. It wants to move us. To touch us. Not accommodate us, make us comfortable." -- Jamake Highwater
Toasty0.com
My Grandkids
|
|
|
|
|
Toasty0 wrote:
How do I get a saved filed to display the same Icon/image as the application?
You need to call SHGetFileInfo through P/Invoke. A perfect example can be found here[^].
|
|
|
|
|
Thanks Nick. I think I've figured out my problem. I have not actually installed the program on my development box so no file association or icon exists yet.
Thank you for your quick response to my question.
Jerry
"Art doesn't want to be familiar. It wants to astonish us. Or, in some cases, to enrage us. It wants to move us. To touch us. Not accommodate us, make us comfortable." -- Jamake Highwater
Toasty0.com
My Grandkids
|
|
|
|
|
Hi,
Would anyone know why creating an instance of a COM Object within a Windows Service would throw up a QueryInterface failed error?
Are there any special permissions required?
Thank you.
|
|
|
|
|
hi,
Does anyone know how can i view/get information about running application on my client pcs in my network through my network server? i want to get license information of the application. i also want to monitor the frequency of usage of the app. what are the things that i need to learn and consider in building such application? need your help and suggestions guys... thnx...
-batmanAgen-
|
|
|
|
|
Hi,
The description is a bit vague, so I'm not really sure what you're going for. If you are talking about writing your own network communication, read up on the multitude of ways to handle such things (web services, .NET remoting, direct TCP/IP communication, etc.).
Another possible solution is to use the performance counters available through Windows. Here's an MSDN search to get you started. http://search.microsoft.com/search/results.aspx?view=msdn&st=b&na=82&qu=performance+counters+c%23&s=1[^] You can also explore this by opening "Administrative Tools" from the "Control Panel", then selecting "Performance".
John
"You said a whole sentence with no words in it, and I understood you!" -- my wife as she cries about slowly becoming a geek.
|
|
|
|