Bug 438100

Summary: Current trait implementation can degrade TI performance
Product: z_Archived Reporter: Dawid Pakula <zulus>
Component: PDTAssignee: PHP Core <php.core-inbox>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: P3 CC: wywrzal
Version: unspecifiedKeywords: performance
Target Milestone: ---   
Hardware: All   
OS: All   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=515483
https://bugs.eclipse.org/bugs/show_bug.cgi?id=520661
https://bugs.eclipse.org/bugs/show_bug.cgi?id=515223
Whiteboard:

Description Dawid Pakula CLA 2014-06-24 16:04:59 EDT
Traits: horrible to debug, nightmare to implement ;). 

They aren't cached, indexed, and persisted in DLTK model. 

PHPModelUtils many times, have to traverse over AST to detect it, next TraitUtils traverse to collect it, asking index for details, and never cache it. 

Fortunately they still aren't popular, but later they'll degrade PDT performance. 

I asked DLTK team in bug 437856 [1] how it should be implemented. 

It could be IMixinContainer / IMixinDeclaration / IMixinDetail. We can also check how it was done for other languages - perl6 (EPIC), Scalar IDE.

As an alternative, could be internal IType with IFields

[1] - https://bugs.eclipse.org/bugs/show_bug.cgi?id=437856
Comment 1 Michal Niewrzal CLA 2015-08-18 17:21:22 EDT
I'm thinking about this issue. What do you mean by IMixinContainer / IMixinDeclaration / IMixinDetail? It's only conception or I just couldn't find it ? :)
Comment 2 Dawid Pakula CLA 2015-08-18 17:47:29 EDT
(In reply to Michal Niewrzal from comment #1)
> I'm thinking about this issue. What do you mean by IMixinContainer /
> IMixinDeclaration / IMixinDetail? It's only conception or I just couldn't
> find it ? :)

It's a conception to introduce new model elements into DLTK for traits, because they are used in many dynamic languages [1].

In theory DLTK have ability to introduce non standard elements but because this feature isn't complete, so probably patch for DLTK will be simpler. 

[1] - https://en.wikipedia.org/wiki/Trait_%28computer_programming%29