Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Christoph

Functions: Performance-Killers?

This topic is 5197 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I noticed that in VB .NET, calling a function needs much time, too much for some real-time algorithms... However, as I can''t implement all the code directly, I need something like the "inline" parameter in C, which speeds up the function-call... Does anybody know a solution? Thanks and greetings

Share this post


Link to post
Share on other sites
Advertisement
VB is a bad choice if you are so concerned about performance.
Note that I''m not trying to start a flamewar here
Why don''t you use c++ for your application?

-Nik

Share this post


Link to post
Share on other sites
quote:
Original post by Nik02
VB is a bad choice if you are so concerned about performance.
Note that I''m not trying to start a flamewar here
Why don''t you use c++ for your application?



He said VB.NET, not VB6. Both C# and VB.NET compile to the same intermediate code, so they are just languages with a different syntax but the same results.
And I think the JIT compiler will inline functions whenever appropriate. Even if it doesn''t, calling a function isn''t that expensive, not even in .NET.

Share this post


Link to post
Share on other sites
Because
1. VB is not too bad in the .net version - of course C++ is better
2. I''m not that good at C++
3. I''m currently working at a school work that is to be presented in october in front of a bunch of conservative anti-gamers (teachers ;-), therefore the code has to be clear and easy to understand...

Share this post


Link to post
Share on other sites
A less radical solution might be to run the vb code through some kind of preprocessor (c''s, m4, etc) and implement the functions as macros.
Or you could rewrite the time critical parts in c as a dll or com object.

Share this post


Link to post
Share on other sites
quote:
Original post by Christoph
Because
1. VB is not too bad in the .net version - of course C++ is better
2. I''m not that good at C++
3. I''m currently working at a school work that is to be presented in october in front of a bunch of conservative anti-gamers (teachers ;-), therefore the code has to be clear and easy to understand...


1. VB is limited on many aspects
2. You should be able to learn C++, it would be a valuable experience... Plus you will have to switch someday, as VB is going to disappear.
3. I consider C++ code to be much clearer and much easier to understand than VB.



Looking for a serious game project?
www.xgameproject.com

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Are you sure that it is the calling of the functions that is too slow?
It seems infinitely more likely that the problem is with your algorithm or implementation than the function call itself.

-Extrarius

Share this post


Link to post
Share on other sites
No, I''ve made time tests with simple math operations, its the call.
And I have already learned C++, but I''m not good enough to write a complex game... With my C, it''s just as with French - I can understand it, but being active... well ;-)

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
quote:
Original post by Max_Payne
2. You should be able to learn C++, it would be a valuable experience... Plus you will have to switch someday, as VB is going to disappear.
3. I consider C++ code to be much clearer and much easier to understand than VB.




2. I bet C++''s usage will drop much faster than VB''s. C++ is a static, complex, binding language that puts too much on the shoulders of the programmers. I foresee a future with languages like Python, Smalltalk or Lisp features.

3. That''s just you. I think Lisp''s syntax is the cleanest (and most beautiful) of any language.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!