|
|
Re: Serialisation time grows exponentially when adding new elements to model instance [message #1712637 is a reply to message #1712120] |
Tue, 27 October 2015 05:27 |
Alex Mil Messages: 5 Registered: October 2015 |
Junior Member |
|
|
Hi,
thanks for your reply, much appreciated. We've worked on reducing the size of our model in an effort to reduce the potential problem space while at the same time reproducing the issue.
Our test projects are available at https://github.com/johnf-repo/xtext
There are two projects using the same model definition:
org.johnf.mydsl1 - this project has no user defined scoping.
org.johnf.mydsl2 - this project has user defined scoping
The model is reduced to having an "entity" with fields that have a type.
Model:
'workspace' name=ID ';'
('description' description=STRING ';')?
(
dataTypes+=(Entity)
)*
(systems+=System)*
;
System:
'system' name=ID '{'
('description' description=STRING ';')?
(imports+=DefinitionImport)*
(
dataTypes+=(Entity)
)*
'}'
;
DefinitionImport:
'import' definition=[Definition|FQN] ';'
;
Definition:
DataType;
Partition:
Model | System
;
CrossReferenceTarget:
Definition
| Field
;
terminal DATE returns ecore::EDate: '0'..'9''0'..'9''0'..'9''0'..'9' '-' '0'..'9''0'..'9' '-' '0'..'9''0'..'9';
terminal INT returns ecore::EInt: ('-')? ('0'..'9')+;
terminal DECIMAL returns ecore::EBigDecimal:
'-'? ('0'..'9')+ '.' ('0'..'9')+;
FQN: // fully qualified name
ID ('.' ID)*
;
//
// Data Types
//
DataType:
BuiltInType | Entity
;
Entity :
'entity' name=ID '{'
('description' description=STRING ';')?
(fields+=Field)*
'}'
;
// Only instantiated "behind the scenes", i.e. no keyword, not called as a rule
BuiltInType:
name=ID description=STRING
;
Field :
name=ID ':' type=[DataType|FQN]
( ('description' description=STRING ';')?
('[' lower=INT ',' (upperUnlimited?='*' | upper=INT) ']' ';')?
// default values: lower=1 and upper=1 set via PostProcessor
| ';'
)
;
The reason for the two models is that the first one shows that there seems to be an issue even without our scoping implementation. In the first model there doesn't seem to be anything custom that could cause this which leads us to believe that it might be an Xtext issue.
The second model shows that using our scoping makes the problem even worse.
Here is a summary of our tests results, these tests are also available in the above projects in github.
org.johnf.mydsl1 - Xtext project without user defined scope
- Loading an empty model, when adding 4000 entities with no fields, the serialization Took 488ms
- Loading an empty model, when adding 1000 entities with 3 fields each, the serialization Took 5,551ms
- Loading a model with 1000 entities with 3 fields each, and without making any modifications, the serialization Took 1,724ms
org.johnf.mydsl2 - Xtext project with user defined scope on field_type
- Loading an empty model, when adding 4000 entities with no fields, the serialization Took 496ms
- Loading an empty model, when adding 1000 entities with 3 fields each, the serialization Took 11,569ms
- Loading a model with 1000 entities with 3 fields each, and without making any modifications, the serialization Took 2,301ms
As you can see, these results show that modifying the model in memory by adding elements (in this case entities) that have cross references, significantly increases the saving time.
Has anybody had experience with this or can help out?
We are at a bit of a loss because this performance issue is becoming a bit of a deal breaker for the use of xtext even though from a development perspective we would love to keep it.
Thanks in advance,
Alex
[Updated on: Tue, 27 October 2015 05:29] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02910 seconds