You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some work was done in .NET here and here. This work should be mimicked (Or at least qualified and checked off that an equivalent piece cannot be done elsewhere).
✨ Do you have a proposal for making it better?
Check equivalent work to PR #336 -> Improved parsing time
Java
JavaScript
Ruby
Go
Python
C
Objective-C
Perl
PHP
Dart
C++
Check equivalent work to PR #344 -> Avoid allocation and improve parsing time
Java
JavaScript
Ruby
Go
Python
C
Objective-C
Perl
PHP
Dart
C++
📚 Any additional context?
Some languages it may not be relevant for
The text was updated successfully, but these errors were encountered:
When reading 1000 times the very_long.feature, IntelliJ's Profiler gives the following flame graph:
Most of time is passed on String trimming (about 50% of total duration). I already worked on the point in the past (#84), but some improvement still needs to be done (I have some ideas on how to improve that😉). Otherwise there is no noticeable performance hot spot.
On one of my real-life project with about 100 rules and 1000 test scenarios, the Parser.parse() takes 340 ms (with about 100 ms of String trimming, that is: only about 30% of the parsing duration).
I'll create an issue on that point.
JMH benchmark code:
public class MyClassBenchmark {
@Benchmark
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MICROSECONDS)
public GherkinDocument original(MyClassPlan plan) {
return plan.parser.parse(plan.featureContent, plan.matcher, "very_long.feature");
}
@Test
void test_for_profiler() {
MyClassPlan plan = new MyClassPlan();
for (int i=0; i<1000; i++) plan.parser.parse(plan.featureContent, plan.matcher, "very_long.feature");
}
}
@State(Scope.Benchmark)
public class MyClassPlan {
TokenMatcher matcher = new TokenMatcher("en");
IdGenerator idGenerator = new IncrementingIdGenerator();
Path path = Paths.get("../testdata/good/very_long.feature");
Parser<GherkinDocument> parser = new Parser<>(new GherkinDocumentBuilder(idGenerator, path.toString()));
String featureContent;
{
try {
featureContent = new String(Files.readAllBytes(path));
} catch (IOException e) {
throw new RuntimeException(e);
}
}
}
🤔 What's the problem you've observed?
Some work was done in .NET here and here. This work should be mimicked (Or at least qualified and checked off that an equivalent piece cannot be done elsewhere).
✨ Do you have a proposal for making it better?
Check equivalent work to PR #336 -> Improved parsing time
Check equivalent work to PR #344 -> Avoid allocation and improve parsing time
📚 Any additional context?
Some languages it may not be relevant for
The text was updated successfully, but these errors were encountered: