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

  • SEARCH
  • Home
  • 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 8585383
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T22:02:57+00:00 2026-06-11T22:02:57+00:00

I’m currently in a low level C class, but I program Javascript as my

  • 0

I’m currently in a low level C class, but I program Javascript as my job.

Here are a couple C optimizations/Problem areas my book has gone over so far (Just started so I don’t have much):

  • Procedure overhead (restoring registers, creating the stack, etc.)
  • Sometimes creating temporary variables instead of reading/writing to memory in loops.

Additionally how much time can be spent ‘optimizing’ Javascript? C is compiled down to machine code and much more time can be spent on compiling an executable. How much time is spent in a typical JS compiler optimizing?

Javascript is a higher level language than C and because of that I don’t actually ‘know’ what is going on underneath. What optimizations should I worry about? Will what I am learning now in C also apply in Javascript?

  • 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-11T22:02:59+00:00Added an answer on June 11, 2026 at 10:02 pm

    Javascript and C have such radically different ways of expressing things that I doubt one could even compare the optimization techniques.

    For this post, I’ll just look at the optimizations the programmer can make:

    C:

    • Choosing the most appropriate data type. (int/long/float/double)
    • Bit fields and aligning on word boundaries.
    • Use of malloc and choosing when to free memory and when to reuse it.
    • Intermediate calcuations

    Javascript:

    • Avoid creating pointless objects when needed. Object re-use
    • Intermediate calculations
    • Avoiding refreshing the DOM too often
    • Set big unused references to null

    Just as a quick example. The two really are worlds apart, so I’d have to simplify optimization techniques down to:

    • Reuse what you can
    • Don’t make what you don’t have to.
    • If you do something computationally expensive and you need it again — save it.
    • Choose an appropriate algorithm.

    The last item on the list is, as far as I am concerned, the most import bit of optimization that any coder can learn how to do.

    • Don’t use the BogoSort if you have a better sort to use. (Hint, you do.)
    • See if your standard library has a fast way of doing what you want to do. Don’t re-invent the wheel until you proved your old wheel doesn’t work.
    • Don’t worry too much about doing micro-optimization until profiling shows you it is worth the effort.

    Disclaimer: Yes, I know the old adage of ‘Premature optimization is the root of all evil.’ Choosing a smart, or at the very least, not terribly dumb way to solve a problem is not premature..

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

Sidebar

Related Questions

I am reading a book about Javascript and jQuery and using one of the
I am currently running into a problem where an element is coming back from
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I used javascript for loading a picture on my website depending on which small
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I want use html5's new tag to play a wav file (currently only supported
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
I am trying to render a haml file in a javascript response like so:

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.