Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [Dltk-dev] Help

Hi Zhao,

CompletionEngine performs quickly enough.
Most of the time is consumed by getScriptFolder() [I've committed the obvious optimization, not sure if we should optimize directory reading - it's performed only once anyway] and H2FileDao.selectById().

It turns out that a lot of processing happens in org.eclipse.dltk.ui.text.completion.ScriptCompletionProposalCollector.processUnprocessedProposals() for fields.
This is a second step performed in UI thread.

Thread [main] (Suspended)   
    ScriptElementImageProvider.computeAdornmentFlags(IModelElement, int) line: 417   
    PHPCompletionProposalLabelProvider(CompletionProposalLabelProvider).decorateImageDescriptor(ImageDescriptor, CompletionProposal) line: 381   
    PHPCompletionProposalLabelProvider(CompletionProposalLabelProvider).createFieldImageDescriptor(CompletionProposal) line: 352   
    PHPCompletionProposalCollector(ScriptCompletionProposalCollector).createFieldProposal(CompletionProposal) line: 630   
    PHPCompletionProposalCollector(ScriptCompletionProposalCollector).createScriptCompletionProposal(CompletionProposal) line: 438   
    PHPCompletionProposalCollector.createScriptCompletionProposal(CompletionProposal) line: 114   
    PHPCompletionProposalCollector(ScriptCompletionProposalCollector).processUnprocessedProposals() line: 329   
...

In this case parent is just SourceType created I think in PhpElementResolver at line 41.
It means that there are cases when your tricks with model elements are not used, and it goes via standard way and uses the parser to build model elements.

Probably we should review that second step for possible optimizations. or just continue with your trick model elements for now.

And please use a java profiler :-)

Regards,
Alex

----- Original Message -----
From: "赵忠伟" <zhaozhongwei@xxxxxxxxxxxxxxxx>
To: "DLTK Developer Discussions" <dltk-dev@xxxxxxxxxxx>
Sent: Sunday, April 25, 2010 4:40:52 PM GMT +06:00 Almaty, Novosibirsk
Subject: Re: [Dltk-dev] Help

But after I comment the code ,it is still very slow,I will try to find other place which cause the problem,thanks both of you!

On 4/25/10, 赵忠伟 <zhaozhongwei@xxxxxxxxxxxxxxxx> wrote:
> Hi Macheal
>
> In method ElementHandler.handle():
>
> if (sourceModule == null) {
>                                         if (projectFragment.isExternal()
>                                                         ||
> projectFragment.isArchive()) {
>                                                 IScriptFolder scriptFolder =
> projectFragment
>
> .getScriptFolder(relativePath
>
>         .removeLastSegments(1));
>                                                 sourceModule = scriptFolder
>
> .getSourceModule(relativePath.lastSegment());
>                                         } else {
>                                                 IProject project =
> projectFragment.getScriptProject()
>
> .getProject();
>                                                 sourceModule =
> DLTKCore.createSourceModuleFrom(project
>
> .getFile(relativePath));
>                                         }
>                                         sourceModuleCache.put(resourcePath,
> sourceModule);
>                                 }
>
> when if (projectFragment.isExternal()|| projectFragment.isArchive()) is true
>
> EFSFileHandle.exists() will be called,this is a file operation,and I did not
> debug into
> DLTKCore.createSourceModuleFrom(project.getFile(relativePath));but
> I am sure it is time consuming too.So in my opinion the CA performance
> bottleneck is in the above code.
>
> I think you know this issue too,my patch is to get sourceModule lazily,and I
> think the other way is to get sourceModule effectively:)
>
>
>
> On Sun, Apr 25, 2010 at 2:21 PM, 赵忠伟 <zhaozhongwei@xxxxxxxxxxxxxxxx> wrote:
>
>> Hi Alex
>>
>>
>> If you have PDT installed,you can try to add ZEND framework to the pdt
>> include path/buildpath.
>>
>>
>> <?php
>> | // "|" is the cursor place,try ctrl+space
>>
>>
>> About *Hierarchy*,if we try to get type hierarchy in CA(even once),it will
>> take a very long time.
>>
>>
>> By the way,I do not think my patch is good either,so I ask your
>> suggestions:)I try to make the dltk code changes as few as possible,so now
>> the patch just looks like a patch of pdt.So I am very glad if dltk can
>> improve this natively.Thanks very much!
>>
>>
>>
>> On Sun, Apr 25, 2010 at 1:45 PM, Michael Spector <spektom@xxxxxxxxx>wrote:
>>
>>> Hi Zhao,
>>>
>>> I think IModelElement must be lazy already, so no file operations are
>>> expected during the code assist time.
>>> May be IO operations you're encountering are not necessary at all?
>>>
>>> Best regards,
>>> Michael
>>>
>>> On Sun, Apr 25, 2010 at 7:34 AM, 赵忠伟
>>> <zhaozhongwei@xxxxxxxxxxxxxxxx>wrote:
>>>
>>>> Hi guys
>>>>
>>>> There is a very annoying performance issue of PDT content assist,and I
>>>> open a bug
>>>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=309422
>>>>
>>>> After I debug ,I found that it is very time consuming in
>>>> ElementHandler.handle to get ISourceModule(it seems that there are file
>>>> operations to get ISourceModule),so I create a patch that get
>>>> ISourceModule
>>>> when needed for content assist,and then the performance is improved much
>>>> more,I am not sure if there are better ways,so I am glad to hear your
>>>> voices!Because when there are 5000 proposals,it will cost more than 5
>>>> sec(longer than the default timeout)!So we have to fix this issue.
>>>>
>>>>
>>>> Thanks very much!!!
>>>>
>>>> --
>>>>
>>>> Thanks!
>>>>
>>>> Best Regards!
>>>>
>>>> Zhao
>>>>
>>>> _______________________________________________
>>>>
>>>> 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
>>>
>>>
>>
>>
>> --
>>
>> Thanks!
>>
>> Best Regards!
>>
>> Zhao
>>
>
>
>
> --
>
> Thanks!
>
> Best Regards!
>
> Zhao
>

--
Sent from my mobile device
_______________________________________________
dltk-dev mailing list
dltk-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/dltk-dev



--

Thanks!

Best Regards!

Zhao

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

Back to the top