473,399 Members | 3,106 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,399 software developers and data experts.

Inline function.....

Is there any inline function concept of C language in .Net Framework 1.1 and
VB.Net Language?

A Smith
Nov 19 '05 #1
8 1347
Huh?

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Neither a follower
nor a lender be.

"Allen Smith" <AS******@hotmail.com> wrote in message
news:#T**************@TK2MSFTNGP12.phx.gbl...
Is there any inline function concept of C language in .Net Framework 1.1 and VB.Net Language?

A Smith

Nov 19 '05 #2
"Allen Smith" <AS******@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Is there any inline function concept of C language in .Net Framework 1.1
and
VB.Net Language?


Why would such a thing be required?

John Saunders
Nov 19 '05 #3
You mean inlining a function as an optimization? The JIT compiler can
do this when compiling the program. There are no directives available
in the language to "hint" at the optimization. Any non-virtual method
call with less than 32 bytes of IL is going to be a candidate for
inlining.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Wed, 8 Dec 2004 10:11:10 -0800, "Allen Smith"
<AS******@hotmail.com> wrote:
Is there any inline function concept of C language in .Net Framework 1.1 and
VB.Net Language?

A Smith


Nov 19 '05 #4
I have written function which has one/two lines of code. Primarily like some
string manipulation. I feel now this is an additional overhead to make a
call to the function. If I can make these functions as inline, it would be
better.
Thanks,
Allen
"John Saunders" <johnwsaundersiii at hotmail.com> wrote in message
news:Ol**************@tk2msftngp13.phx.gbl...
"Allen Smith" <AS******@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Is there any inline function concept of C language in .Net Framework 1.1
and
VB.Net Language?


Why would such a thing be required?

John Saunders

Nov 19 '05 #5
"Allen Smith" <AS******@hotmail.com> wrote in message
news:e0**************@TK2MSFTNGP09.phx.gbl...
I have written function which has one/two lines of code. Primarily like
some
string manipulation. I feel now this is an additional overhead to make a
call to the function. If I can make these functions as inline, it would be
better.


How do you know that it would be better? Why would it not be worse? Did you
measure?

John Saunders
Nov 19 '05 #6
I did not run any performance test.

It makes sense for me there will be additional CPU cycles to call functions.

If I write the code in all the places instead of function may be a good
approach. Just a thought.

Thanks for your all replies.

Allen

"John Saunders" <johnwsaundersiii at hotmail.com> wrote in message
news:uH**************@TK2MSFTNGP14.phx.gbl...
"Allen Smith" <AS******@hotmail.com> wrote in message
news:e0**************@TK2MSFTNGP09.phx.gbl...
I have written function which has one/two lines of code. Primarily like
some
string manipulation. I feel now this is an additional overhead to make a
call to the function. If I can make these functions as inline, it would be better.
How do you know that it would be better? Why would it not be worse? Did

you measure?

John Saunders

Nov 19 '05 #7
"Allen Smith" <AS******@hotmail.com> wrote in message
news:OD**************@TK2MSFTNGP14.phx.gbl...
I did not run any performance test.

It makes sense for me there will be additional CPU cycles to call
functions.
What makes sense is not always so. In this particular case, compilers have
been better at this than humans for the past decade or so. For at least that
long it has been a waste of time to specify inlining. In fact, doing so can
prevent some compilers from doing a good job deciding which code should be
inline.
If I write the code in all the places instead of function may be a good
approach. Just a thought.


I find that it is a very bad idea to solve problems which do not exist.
Therefore, before I optimize my code, I make sure that it works (as
non-working code is usually worse than slow code, since I don't write
horribly slow code any more). Once it works, I then look to see if there are
performance problems. If so, I then look for the solution to those problems.

It may never turn out that the solution to a performance problem involves
inlining.

John Saunders
Nov 19 '05 #8
Thanks for your inputs.
allen

"John Saunders" <johnwsaundersiii at hotmail.com> wrote in message
news:#a**************@TK2MSFTNGP09.phx.gbl...
"Allen Smith" <AS******@hotmail.com> wrote in message
news:OD**************@TK2MSFTNGP14.phx.gbl...
I did not run any performance test.

It makes sense for me there will be additional CPU cycles to call
functions.
What makes sense is not always so. In this particular case, compilers have
been better at this than humans for the past decade or so. For at least

that long it has been a waste of time to specify inlining. In fact, doing so can prevent some compilers from doing a good job deciding which code should be
inline.
If I write the code in all the places instead of function may be a good
approach. Just a thought.
I find that it is a very bad idea to solve problems which do not exist.
Therefore, before I optimize my code, I make sure that it works (as
non-working code is usually worse than slow code, since I don't write
horribly slow code any more). Once it works, I then look to see if there

are performance problems. If so, I then look for the solution to those problems.
It may never turn out that the solution to a performance problem involves
inlining.

John Saunders

Nov 19 '05 #9

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

Similar topics

13
by: A | last post by:
Hi, I'm having problems completing a project in C++. I have been using inline functions in some of my header files. I have only done so for simple functions that only have 1 statement (eg....
14
by: Chris Mantoulidis | last post by:
I am not clear with the use of the keyword inline... I believe you add it do a function when you implement the function inside the header file where the class is stored... But is that all? What...
47
by: Richard Hayden | last post by:
Hi, I have the following code: /******************************** file1.c #include <iostream> extern void dummy(); inline int testfunc() {
20
by: Grumble | last post by:
Hello everyone, As far as I understand, the 'inline' keyword is a hint for the compiler to consider the function in question as a candidate for inlining, yes? What happens when a function with...
5
by: Tony Johansson | last post by:
Hello experts! I reading a book called programming with design pattern revealed by Tomasz Muldner and here I read something that sound strange. Here is the whole section: It says" Because...
6
by: RainBow | last post by:
Greetings!! I introduced the so-called "thin-template" pattern for controlling the code bloat caused due to template usage. However, one of the functions in the template happens to be virtual...
18
by: Method Man | last post by:
If I don't care about the size of my executable or compile time, is there any reason why I wouldn't want to inline every function in my code to make the program run more efficient?
9
by: Bilgehan.Balban | last post by:
Hi, If I define an inline function in one .c file, and use it from another, after compiling and linking the two, it seems the function is not inlined but rather called as a regular function. I...
7
by: Wu Shaohua | last post by:
Hi Guys, 1. As we know usually we should not define a constructor as inline. I also learned if we define a member function inside the class this member function will be automatically be...
12
by: sam_cit | last post by:
Hi Everyone, I have few questions on inline functions, when i declare a function as inline, is it for sure that the compiler would replace the function call with the actual body of the function?...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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
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.