Opened 11 years ago

Closed 10 years ago

#1353 closed defect (invalid)

Xinha.free is slower than is needed

Reported by: guest Owned by: gogo
Priority: normal Milestone: 0.96
Component: Xinha Core Version: trunk
Severity: normal Keywords: memory leak, internet explorer, patch
Cc: randy@…

Description

There is a great likelihood that the Xinha.free function could be improved if the function only attempted to set the property to null if the property was confirmed to start with an even handler such as 'on'. The patch below executes the collectGarbageForIE function in IE 7 about one quarter second faster for me (with a blank message body)

Xinha.free=function(obj,prop){
if(obj == 'javascript:void(0)'){return;}
else if(obj&&!prop){
for(var p in obj){
Xinha.free(obj,p);
}
}else if(obj && prop.indexOf("src")==-1 && prop.indexOf("inner")==-1){
try{
obj[prop]=null;
}
catch(x){}
}
};

Also, the flushEvent function has a series of iterating x++ bits of code that are not used anywhere within the function and add a tiny bit of processing time to the garbagecollect helper function.

Change History (1)

comment:1 Changed 10 years ago by gogo

  • Resolution set to invalid
  • Status changed from new to closed
  • I don't see what's going on there in your code, why would obj ever be that exact string javascript:void(0), why are you skipping "inner" (assuming this is innerHTML, but it's not created a problem before) and apart from those two things I don't see a difference.
Note: See TracTickets for help on using tickets.