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 8856253
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T14:18:57+00:00 2026-06-14T14:18:57+00:00

My understanding of JavaScript compilation is that it condenses and minifies your code to

  • 0

My understanding of JavaScript “compilation” is that it condenses and minifies your code to ultimately save bytes.

Does either condensing or minification make JavaScript run any faster?

Take the following examples for consideration:

var abcdefghijklmnopqrstuvwxyz = 1;
// vs.
var a=1;
var b = function() {
    // Here is a comment
    // And another
                                                                                                                        // White space
    return true;
};

// vs.

var b=function(){return true}

I ran these examples through jsPerf with little or no difference.

Can compilation of JavaScript make it any faster or slower, in addition to saving bytes?

  • 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-14T14:18:58+00:00Added an answer on June 14, 2026 at 2:18 pm

    Yes, compilation in the sense of the transforms applied by something like the Google Closure Compiler can make your script run faster. Consider this very simple example:

    var x = ["hello", "james"].join(" ");
    

    That compiles to:

    var x="hello james";
    

    Which is both less code and quicker to run. Obviously that’s a silly example. I would hope you would write the compiled version yourself. However, it does demonstrate that Closure is capable of giving performance improvements as well as just file size improvements.

    From the Closure docs (emphasis added):

    The Closure Compiler is a tool for making JavaScript download and run faster. It is a true compiler for JavaScript. Instead of compiling from a source language to machine code, it compiles from JavaScript to better JavaScript.

    Edit

    For an example of the Closure compiler actually increasing the size of a JavaScript file in an attempt to offer performance improvements, see my answer to this question.

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

Sidebar

Related Questions

While debugging a javascript code that uses jQuery I found the following code: [0,
I'm having difficulties understanding behavior of Javascript. Code: function getPosition(element){ var position = {
I have a pretty good understanding of Javascript, except that I can't figure out
I'm having difficulty understanding variable shadowing in JavaScript based on scopes. Consider this small
I'm having trouble understanding the workings of Javascript...I want to pass a form name
I am new to JavaScript so please be understanding of my situation. I have
Just when I think I'm getting an understanding of the syntax of Javascript, I
Understanding that I should probably just dig into the source to come up with
My understanding is that when using && as an mathematical operation in Java, if
My understanding is that OpenSSL is deprecated in OSX 10.7 in favor of Common

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.