473,406 Members | 2,217 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Performance question

My colleague was trying to do performance testing on function calls in
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?

Any thoughts would be appreciated.

Thanks,

Shane
Nov 21 '05 #1
1 946
In article <O6**************@TK2MSFTNGP10.phx.gbl>, shanesREMOVETHIS@dv-
corp.com says...
My colleague was trying to do performance testing on function calls in
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?


Nothing gets put into the GAC unless it's specifically told to. My
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.

--
Patrick Steele
Microsoft .NET MVP
http://weblogs.asp.net/psteele
Nov 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Randell D. | last post by:
Folks, I have a Javascript performance question that I might have problems explaining... In PHP, better performance can be obtained dealing directly with a variable, as opposed to an element...
115
by: Mark Shelor | last post by:
I've encountered a troublesome inconsistency in the C-language Perl extension I've written for CPAN (Digest::SHA). The problem involves the use of a static array within a performance-critical...
6
by: Mike | last post by:
Lets just say my app is done HOO HOO. Now, I'm accessing the database via a web service and one thing i noticed that my app is running real slow. When I first started working on the app is ran...
5
by: Markus Ernst | last post by:
Hello A class that composes the output of shop-related data gets some info from the main shop class. Now I wonder whether it is faster to store the info in the output class or get it from the...
30
by: galiorenye | last post by:
Hi, Given this code: A** ppA = new A*; A *pA = NULL; for(int i = 0; i < 10; ++i) { pA = ppA; //do something with pA
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.