|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Performance questionassembly verses calls to external assemblies (dll's). He said, he made a function in VB.NET inside of a DLL project, and compiled it. The function does nothing, and returns a boolean. He opened a separated Windows Forms project, referenced the DLL project and create the same simple function as a private function in the winforms project. Then he called each of them several times to test time of execution. He was surprised that the call to the DLL was faster than the one to the local function. I haven't seen the test, but didn't know why this would be. Of course we aren't talking about a great time difference but it was puzzling. Could it be that the DLL gets put in the GAC and the winforms app doesn't and this would give it some sort of performance gain? Any thoughts would be appreciated. Thanks, Shane In article <O6RD11CQFHA.1***@TK2MSFTNGP10.phx.gbl>, shanesREMOVETHIS@dv-
corp.com says... > My colleague was trying to do performance testing on function calls in Nothing gets put into the GAC unless it's specifically told to. My > assembly verses calls to external assemblies (dll's). He said, he made a > function in VB.NET inside of a DLL project, and compiled it. > The function does nothing, and returns a boolean. He opened a separated > Windows Forms project, referenced the DLL project and create the same simple > function as a private function in the winforms project. Then he called each > of them several times to test time of execution. > > He was surprised that the call to the DLL was faster than the one to the > local function. I haven't seen the test, but didn't know why this would be. > Of course we aren't talking about a great time difference but it was > puzzling. Could it be that the DLL gets put in the GAC and the winforms app > doesn't and this would give it some sort of performance gain? guess would be that the JIT compiler sees that the DLL function contains no executable code that can change the return value and therefore it might actually cache the value. Or maybe calls to the DLL function are JIT-compiled into an assignment based on the return value. So if the DLL function was: public function GetData() as boolean return True end function Calling the function from the winform as: dim data as Boolean = thedll.GetData() May be compiled at run-time into something like this: dim data as Boolean = True This is all just a guess.
How are you handling EUL agreement?
Loop ? How to update an application Panel-height greater Int16.MaxValue? Regex. Split or Split Finding Version of All Asemblies Required by Application How to Publish a Project to Production Server special character inside a string Category does not exist? repainting problem |
|||||||||||||||||||||||