Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [Dltk-dev] profiling stuff..

Hi Johan,

I've updated this stuff today.
It should work without slowdown now.
I've committed this code to HEAD in about 3 hours ago. So please update.

Best regards,
Andrei Sobolev.

----- Original Message -----
From: "Johan Compagner" <jcompagner@xxxxxxxxx>
To: "DLTK Developer list" <dltk-dev@xxxxxxxxxxx>
Sent: Thursday, May 29, 2008 9:30:25 PM GMT +06:00 Almaty, Novosibirsk
Subject: [Dltk-dev] profiling stuff..


Hi, 

I am profiling some stuff because saving bit javascript files are really slow for us 
Now i am seeing for example this as a hotspot: 

LocalEnvironment: 

public boolean hasProject(IProject project) { 
if (project.isAccessible()) { 
IPath location = project.getLocation(); 
if (location != null) { 
File file = new File(location.makeAbsolute().toOSString()); 
if (file.exists()) { 
return true; 
} 
} 
} 
return false; 
} 

and then the file.exists() call. 

This is by itself not really slow of course 
But by parsing the JS files many ModelElements (subclasses) are created 
and that has an equal method: 

public boolean equals(Object o) { 

if (this == o) 
return true; 

IEnvironment environment = EnvironmentManager.getEnvironment(this); 
if (o instanceof IModelElement && environment != null) { 
IEnvironment environmento = EnvironmentManager 
.getEnvironment((IModelElement) o); 
if (!environment.equals(environmento)) { 
return false; 
} 
} 

that is called a lot.. so that getEnviroment() is hit many many times. 

If for example i quickly do in hasProject() just return true.. 
Then i gain 3 seconds! for 1 save of a js file. 

But i dont know where to do stuff. Where can we cache stuff or do we really need that exists() call 

johan 

_______________________________________________
dltk-dev mailing list
dltk-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/dltk-dev


Back to the top