Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9051825
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T13:00:37+00:00 2026-06-16T13:00:37+00:00

it’s my first post here. I know that the question may seem vague i’ll

  • 0

it’s my first post here.

I know that the question may seem vague i’ll try to be clear…

globally without targeting any interpreted language (well i’m using C# currently but i think the answer should work for others too…)

I wonder, does this type of call :

Afunction(var1,var2,AnotherFunction(var3,var2,AthirdFunction(Avector.z)),Mathf.RoundToInt(Avector.x));

Will run faster than :

Type var1 = avalue;
Type var2 = avalue;
Type var3 = avalue;
Type var4 = AthirdFunction(Avector.z);
Type var5 = Mathf.RoundToInt(Avector.x);
Type var6 = AnotherFunction(var3,var2,var4);

Afunction(var1,var2,var6,var5);

I know that the second way is easier to read, but does it runs faster, knowing that i’ll probably call this function extensively (lets say, in a graphic app, every frame).
And about memory use, is it better to create more variables to destroy it right after using the function, or to directly code everything inside “Afunction” while declaring as less variables as possible…

(and for understanding : Afunction(), AnotherFunction() and AthirdFunction() are already declared somewhere else)

I hope this type of question is not outside of the forum rules of use…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T13:00:39+00:00Added an answer on June 16, 2026 at 1:00 pm

    Assuming a reasonable compiler, the algorithms you use in Afunction, AnotherFunction, and AthirdFunction have way more impact on performance than anything else that you asked above. Generally you worry about what you’ve asked once you have the most efficient function possible.

    Plus, compilers will inline function calls which means that you may call

    return_value = fx( A(), B() );
    

    But if you were to look at what passes for assembler output for your compiler, things may not look that way.

    There is overhead with invoking a function call, and it is system and compiler architecture that dictates what that overhead will be.

    If this were an interpreted language like awk or BASIC, then the second code block, calling things outside a function linearly, will run faster. Or more correctly it did back in 1980’s on DEC PDP’s.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I know there's a lot of other questions out there that deal with this
I'm trying to create an if statement in PHP that prevents a single post
Let's say I'm outputting a post title and in our database, it's Hello Y’all
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I've got a string that has curly quotes in it. I'd like to replace
I have a small JavaScript validation script that validates inputs based on Regex. I
I have a French site that I want to parse, but am running into
I am doing a simple coin flipping experiment for class that involves flipping a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.