Bug 516733 - Lambda parameters: Horrendous performance issue
Summary: Lambda parameters: Horrendous performance issue
Status: NEW
Alias: None
Product: Xtend
Classification: Tools
Component: Core (show other bugs)
Version: 2.10.0   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-05-16 10:02 EDT by Nils Ruhr CLA
Modified: 2017-12-08 09:14 EST (History)
2 users (show)

See Also:


Attachments
Converter1.xtend, Converter2.xtend (6.40 KB, application/octet-stream)
2017-05-16 10:02 EDT, Nils Ruhr CLA
no flags Details
All files as an Eclipse project (572.19 KB, application/octet-stream)
2017-05-16 11:11 EDT, Nils Ruhr CLA
no flags Details
Screenshot from yourkit (100.19 KB, image/png)
2017-05-16 12:35 EDT, Christian Dietrich CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nils Ruhr CLA 2017-05-16 10:02:10 EDT
Created attachment 268376 [details]
Converter1.xtend, Converter2.xtend

Hi.

I've attached two files:
- Converter1.xtend
- Converter2.xtend

Both classes are the same except for one tiny detail:
- Converter1.xtend contains lambdas in the following form: (...).map[convert]
- On the other hand Converter2.xtend specifies the parameter for all lambdas: (...).map[k|k.convert]

If you open both files in the Xtend editor you will notice that calculating the outline for Converter1.xtend takes much more time than calculating the outline for Converter2.xtend.

Also building Conveter1.xtend takes a lot of time. Here's an excerpt from Xtend's build console:

[Worker-58] Building converters
[Worker-58] indexing platform:/resource/converters/models/com/example/converter/Converter1.xtend
[Worker-58] Build converters in 5595 ms
[Worker-58] Building converters
[Worker-58] Build converters in 0 ms
[Worker-57] Building converters
[Worker-57] indexing platform:/resource/converters/models/com/example/converter/Converter2.xtend
[Worker-57] Build converters in 1077 ms
[Worker-57] Building converters
[Worker-57] Build converters in 0 ms
[Worker-14] Building converters
[Worker-14] indexing platform:/resource/converters/models/com/example/converter/Converter1.xtend
[Worker-14] Build converters in 5788 ms
[Worker-14] Building converters
[Worker-14] Build converters in 0 ms
[Worker-66] Building converters
[Worker-66] indexing platform:/resource/converters/models/com/example/converter/Converter2.xtend
[Worker-66] Build converters in 948 ms
[Worker-66] Building converters
[Worker-66] Build converters in 0 ms

I haven't attached any other files the Converter classes reference, because it doesn't change the issue. (Actually it does in the sense that resolving all the referenced types takes a lot of time. And with all types resolved you will still experience the huge performance difference.)
Comment 1 Christian Dietrich CLA 2017-05-16 10:08:36 EDT
could you share the type classes as well
Comment 2 Nils Ruhr CLA 2017-05-16 11:11:30 EDT
Created attachment 268377 [details]
All files as an Eclipse project
Comment 3 Nils Ruhr CLA 2017-05-16 11:13:09 EDT
Converter Xtend classes:
com.example.converter.Converter1
com.example.converter.Converter2
Comment 4 Nils Ruhr CLA 2017-05-16 11:18:12 EDT
Build log (all types can be resolved):

[Worker-89] Building converters
[Worker-89] indexing platform:/resource/converters/models/com/example/converter/Converter1.xtend
[Worker-89] Build converters in 41019 ms
[Worker-89] Building converters
[Worker-89] Build converters in 0 ms
[Worker-105] Building converters
[Worker-105] indexing platform:/resource/converters/models/com/example/converter/Converter2.xtend
[Worker-105] Build converters in 2741 ms
[Worker-105] Building converters
[Worker-105] Build converters in 1 ms
[Worker-108] Building converters
[Worker-108] indexing platform:/resource/converters/models/com/example/converter/Converter1.xtend
[Worker-108] Build converters in 40137 ms
[Worker-108] Building converters
[Worker-108] Build converters in 0 ms
[Worker-94] Building converters
[Worker-94] indexing platform:/resource/converters/models/com/example/converter/Converter2.xtend
[Worker-94] Build converters in 1809 ms
[Worker-94] Building converters
[Worker-94] Build converters in 0 ms
Comment 5 Christian Dietrich CLA 2017-05-16 12:35:16 EDT
Created attachment 268382 [details]
Screenshot from yourkit