-
-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use Gherkin3 instead of Gherkin2 #93
Conversation
be287df
to
d2dc089
Compare
Woo!
Do you see any reason this can't go into production?
|
I do not really see any reason that this can't go into production. The three things to do to get it there are:
The defensive approach would be to first release a Cucumber-Ruby v2.0.1 with what already is on the master of Cucumber-Ruby and Cucumber-Ruby-Core, and then (at the same time almost) release a Cucumber-Ruby v2.1.0 using Gherkin3. Then no unforeseen issue with the Gherkin3 integration would block anyone to use the changes already made after Cucumber-Ruby v2.0.0. |
@mattwynne @brasmusson I guess we should probably benchmark it with a large set of features before we release it. We are moving from a C parser to ruby parser... History: https://groups.google.com/forum/#!topic/cukes/usj_xgK0aKg |
Do you have release karma for cucumber-ruby and cucumber-ruby-core yet @brasmusson? Want ‘it? |
@mattwynne No, I do not have release karma for cucumber-ruby and cucumber-ruby-core. Sure, why not? You can give it to me. |
Great! Please see https://github.com/cucumber/cucumber-ruby/blob/master/CONTRIBUTING.md#gaining-release-karma https://github.com/cucumber/cucumber-ruby/blob/master/CONTRIBUTING.md#gaining-release-karma |
d2dc089
to
3047f5c
Compare
I used the
(and also with some comments, descriptions, and tags). With Ruby 2.1 on my (not so modern/fast) Linux box the results were:
With Ruby 2.1 and Gherkin3 on Travis the results were:
|
So it's 3-4 times slower than Gherkin2. Not too shabby considering this is pure ruby competing against C. Not worth optimising IMO - this should be fast enough. |
It doesn't make for a great headline, but I agree that parse time is rarely the bottleneck for someone's feature suite. Presumably, if this does start to look like a problem for our users, we can use Berp to generate a C-based parser for Ruby to use? |
The bottleneck is most likely in string scanning in the lexer, so it would have to be hand-written in C. Berp only generates the parser, not the lexer. Doable for sure if we need it. |
33b0bdf
to
6014548
Compare
Revert back to using the ast_builder to be able to distribute the language and comments from the feature down the tree before the ast classes are created.
That is instead of subclassing the Gherkin3::AstBuilder, feed the gherkin3 ast into the Cucumber::Core::Gherkin::AstBuilder to transform it to a cucumber-core ast.
6014548
to
9d135f3
Compare
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
This PR make Cucumber-Ruby-Core use (the parser of) Gherkin3 instead of Gherkin2. Some notes: