I would like to know if using prototype in jscript on a classic asp server uses more server memory when multiple users are connected than references to functions or is it the same.
Example:
function SomeClass(){
this.someMethod = this.myfunc;
}
SomeClass.prototype.myfunc = function(...
as opposed to:
function SomeClass(){
this.someMethod = myfunc;
}
function myfunc(...
The ASP server will typically create multiple scripting engines to serve multiple users, so there will always be multiple copies of the method in memory, regardless of whether you use prototypes or not. That being said, using prototypes will save memory within each scripting engine.
References:
As an aside, typically, prototype methods are declared as:
This might save a miniscule amount of memory and/or processing time since you’re not creating a
someMethodproperty for every newSomeClassobject, but I don’t expect the savings to be much, since you’re just setting a reference to a function object.