| Summary: | [xtend][templates] Performance improvement by not emitting indentation strings | ||
|---|---|---|---|
| Product: | [Tools] Xtend | Reporter: | Michael Vorburger <mike> |
| Component: | Core | Assignee: | Project Inbox <xtend-inbox> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P3 | CC: | christian.dietrich.opensource, karsten.thoms, nite |
| Version: | 2.9.1 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| See Also: |
https://github.com/eclipse/xtext-xtend/pull/69 https://github.com/eclipse/xtext-core/pull/207 https://github.com/eclipse/xtext-eclipse/pull/143 https://github.com/eclipse/xtext-extras/pull/81 https://github.com/eclipse/xtext-lib/pull/29 https://github.com/eclipse/xtext-web/pull/25 https://github.com/eclipse/xtext-xtend/pull/99 |
||
| Whiteboard: | v2.11 | ||
FYI There is some other Xtend template performance work in bug 427909 .. GitHub Pull Request 69 created by [rovarga] https://github.com/eclipse/xtext-xtend/pull/69 GitHub Pull Request 207 created by [kthoms] https://github.com/eclipse/xtext-core/pull/207 GitHub Pull Request 143 created by [kthoms] https://github.com/eclipse/xtext-eclipse/pull/143 GitHub Pull Request 81 created by [kthoms] https://github.com/eclipse/xtext-extras/pull/81 GitHub Pull Request 29 created by [kthoms] https://github.com/eclipse/xtext-lib/pull/29 From: genie@eclipse.org Subject: [Bug 507077] @id = 507077 @see_also = https://github.com/eclipse/xtext-idea/pull/24 GitHub Pull Request 24 created by [kthoms] https://github.com/eclipse/xtext-idea/pull/24 GitHub Pull Request 25 created by [kthoms] https://github.com/eclipse/xtext-web/pull/25 GitHub Pull Request 99 created by [kthoms] https://github.com/eclipse/xtext-xtend/pull/99 @kthoms is there something left for this? Fixed in 2.11 |
(I'm filing this issue on behalf of Robert Varga, who is about to but doesn't have an eclipse.org account yet; "Due to SPAM if you are a *NEW* user and wish to file bugs you will need to contact webmaster at eclipse dot org to be granted permission. All other users should be unaffected by this change." <= he's been waiting to hear back for 3 days..) Java code generated from Xtend routinely contains output like: public CharSequence packageDefinition() { StringConcatenation _builder = new StringConcatenation(); _builder.append("package "); String _packageName = this.type.getPackageName(); _builder.append(_packageName, ""); _builder.append(";"); return _builder; } While StringConcatenation will detect the fact the indentation string is empty, it is at the cost of runtime performance. Before emitting the call to StringConcatenation, check if our literal would end up being an empty string. A Pull Request with a concrete proposal to improve performance of Xtend templates based on above is about to be submitted on Git Hub.