Bug 438100 - Current trait implementation can degrade TI performance
Summary: Current trait implementation can degrade TI performance
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: PDT (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: PHP Core CLA
QA Contact:
URL:
Whiteboard:
Keywords: performance
Depends on:
Blocks:
 
Reported: 2014-06-24 16:04 EDT by Dawid Pakula CLA
Modified: 2020-05-14 10:15 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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