| Summary: | [tests] Xtext parser is eleven times slower | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Modeling] OCL | Reporter: | Ed Willink <ed> | ||||
| Component: | Core | Assignee: | OCL Inbox <mdt-ocl-inbox> | ||||
| Status: | CLOSED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | juan.cadavid, sebastian.zarnekow | ||||
| Version: | 3.0.0 | ||||||
| Target Milestone: | RC1 | ||||||
| Hardware: | PC | ||||||
| OS: | Windows Vista | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
Hi Ed, did you try to enable memoization for your parser? No. What is memoization? There is no mention in the Xtext user guide. pleaes add
options = {
backtrack = true
memoize = true
}
to the workflow that generates the parsers. It enables caching for the backtracking algorithm of Antlr.
Changing
options = { backtrack = true classSplitting = true }
to
options = { backtrack = true memoize =true classSplitting = true }
seems to make no difference to the speed.
Generalizing the grammar to avoid backtracking reduced the speed difference to perhaps two times. Two times will do. Xtext2LPG is a separate issue. CLOSED after more than a year in RESOLVED state. and CLOSE |
Created attachment 175046 [details] JUnit tests to measure parser speed Comparison of parser speed for RoyalAndLoyal.ocl suggests that the Xtext parser is eleven times slower than the LPG parser. (1.1 compared to 0.1 seconds for 350 lines). See MODELS 2010 OCL workshop paper submission for details. [Something dreadful happens if the full LoadTest is run. Saving the Xtext results takes 60 seconds every time.]