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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:45:19+00:00 2026-05-27T07:45:19+00:00

Are there any benefits from prototype methods except it’s context and global availability across

  • 0

Are there any benefits from prototype methods except it’s context and global availability across all instances?

Creating new instance of object without prototyped methods eats more memory than vice versa?

Just can’t understand, why some developers are storing initial methods inside prototype when shared context is not required.

The only thing i’m thinking about is memory usage…

// first one
function t(){
    this.method1=function(){

    };
    this.method2=function(){

    };
}

// second one
function tt(){

}
tt.prototype={
    method1:function(){

    }
    ,method2:function(){

    }
}

var storage1=[];
var storage2=[];

var i=0;
while(i<10000) {
    storage1.push(new t());
    storage2.push(new tt());    
    i++;    
}
  • 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-05-27T07:45:20+00:00Added an answer on May 27, 2026 at 7:45 am

    Yes, it eats tons of memory and the memory eating scales with how complex the “class” is and how many instances you create. This is a very good reason to use prototyped methods and greatly outweighs the benefits from “private methods”.

    I don’t know what you mean by “when shared context is not required”.

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

Sidebar

Related Questions

Are there any specific benefits derived from defining a utility function directly on the
Are there any performance benefits to be gained from passing objects like WebControls by
Is there any performance benefits in INSERT INTO table1( column1) select * from table2;
When using linq to sql are there any benefits of using subsonic's active record
When setting up a rollover effect in HTML, are there any benefits (or pitfalls)
Are there any performance benefits to me not using the gridview in asp.net for
Is there any way to get the benefits of SSIS 2008 (including the performance
Are there any benefits to using the 'window' prefix when calling javascript variables or
Should I use high numbers for user IDs in database? Are there any benefits
Is there any benefit in using a <blockquote> element over a <div> ? I

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.