[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [Dltk-dev] Re: is the isSyncrhonized() check in DLTKContentTypeManager.isValidResourceForContentType() needed? (and one other performance item)
|
Johan,
You are right. I have removed the isSync() check. If resource is out of sync then IFile.getContents() will throw CoreException anyway.
Actually, I would like to know if you have only *.js files in your project (they should be matched by name in the isValidFileNameForContentType call above),
or source folders contain multiple files with other extensions or without extension too? Can those files contain javascript code?
Since DLTK contains no content describer for javascript - I have changed canValidateContent() methods in JavaScriptLanguageToolkit to always return false. Feel free to undo this change if needed :)
The strange thing here is that checking timestamp for 200 files requires 7 seconds...
Regarding ValidatorRuntime - it should be called about 2-3 times per build operation - I don't think it would be significant time (also it is called from the reconciler, but that is another story).
Alex
----- Original Message -----
From: "Johan Compagner" <jcompagner@xxxxxxxxx>
To: "DLTK Developer Discussions" <dltk-dev@xxxxxxxxxxx>
Sent: Saturday, September 20, 2008 2:11:33 PM GMT +06:00 Almaty, Novosibirsk
Subject: [Dltk-dev] Re: is the isSyncrhonized() check in DLTKContentTypeManager.isValidResourceForContentType() needed? (and one other performance item)
Yes first part is for the content type check.
That IResource.isSyn.. Is an expensive operation, the javadoc even says that.
I will see for how many an what kind of files that is called, but if
that is for every file then yes i can think of why it is slow, because
we have many many files. But even if it is just for js files then the
project i was testing voor is just a start i guess there are now 200
js files but that could easily grow over a 1000..
In absoluut numbers: 12.5 seconds build time before the 2 changes and
with the 2 changes 5 seconds.
I know this is not the world but if the project i test agains grows
and some things are ui blocking when a build is done this could get
annoying...
Synchhronized check is so expensive because it reads the ResourceInfo,
and where ever that happens for example Project.hasNature or isOpen
all those shoulnt be called in a loop. I have profiled now quite a bit
in our app and everytime i optimize code that does touch that
ResourceInfo get internally in eclipse the performance improved in
factors so not jus something like 10 or 20% but sometimes even 10-20
times as fast... Its just expensive I/O
Do we really care if the file is in sync (which is 99% of the time true anyway)
Johan
On 9/20/08, Alex Panchenko <alex@xxxxxxxxx> wrote:
> Johan,
>
> The first part seems to be related to the
> DLTKContentTypeManager#isValidResourceForContentType.
>
> This code is executed after file extension was not met - the next step is
> try to detect if the file is a script by content (most of the detection is
> done by the 1st line e.g. #!/usr/bin/ruby or #!/usr/bin/tclsh).
>
> The isSynchronized() check is done before actually reading the resource
> content, it should not take too long but I will check.
>
> The questions are:
> - do you have a lot of non .js files in the source folders?
> - do you have any content describers for the javascript?
>
> The second part: commented line in ValidatorRuntime is to compensate some
> missing functionality - I will take care of it on the next week.
>
> Btw, what is the absolute value (I mean in seconds) of your 2.5 times
> faster?
> I have never seen this code takes significant time when building ruby or
> TCL.
>
> Regards,
> Alex
>
> ----- Original Message -----
> From: "Johan Compagner" <jcompagner@xxxxxxxxx>
> To: "DLTK Developer list" <dltk-dev@xxxxxxxxxxx>
> Sent: Saturday, September 20, 2008 5:02:34 AM GMT +06:00 Almaty, Novosibirsk
> Subject: [Dltk-dev] is the isSyncrhonized() check in
> DLTKContentTypeManager.isValidResourceForContentType() needed? (and one
> other performance item)
>
>
>
> That isSynchronized() call in the if:
>
> // Check resources accessibility and synchronization
> if (!resource.isAccessible()
> || !resource.isSynchronized(IResource.DEPTH_ZERO)) {
> return false;
> }
>
> is a hotspopt when i profile now a full build.
>
> and another thing is this one in ValidatorRuntime
>
> private static void initializeValidators() {
> ValidatorDefinitionsContainer validatorDefs = null;
> boolean setPref = false;
> synchronized (fgValidatorLock) {
> if (isInitialized) {
> // return;
> }
>
>
>
> why is that return disabled? Annotations do say that it is only called once
> but this is not the case
> it is called over and over again for every build.
>
> If i enable that return and comment that above if then my build is about 2.5
> times faster
> so the question is do we really need to have a isSync call and why must the
> validators constantly be build? Arent those the same for a run of eclipse?
>
> johan
>
>
> _______________________________________________
> dltk-dev mailing list
> dltk-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/dltk-dev
> _______________________________________________
> dltk-dev mailing list
> dltk-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/dltk-dev
>
_______________________________________________
dltk-dev mailing list
dltk-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/dltk-dev