Skip to content

Build a parser in C#4368

Merged
rmosolgo merged 16 commits intomasterfrom
yacc-parse
Mar 28, 2023
Merged

Build a parser in C#4368
rmosolgo merged 16 commits intomasterfrom
yacc-parse

Conversation

@rmosolgo
Copy link
Copy Markdown
Owner

@rmosolgo rmosolgo commented Mar 3, 2023

Like #4366 , this ports the existing parser (racc) into a C extension (using bison).

It looks like it's about 10x faster: After improvements to the Ruby scanner, the C parser is 7-9x faster:

  ~/code/graphql-ruby $ be rake bench:parse
  # ...
  parse - introspection
-                           1.243k (± 8.4%) i/s -      6.174k in   5.005459s
+                          11.068k (± 2.8%) i/s -     55.650k in   5.031916s
-    parse - fragments      1.870k (± 7.0%) i/s -      9.353k in   5.029178s
+    parse - fragments     14.839k (± 6.1%) i/s -     75.168k in   5.086781s
-    parse - big query    222.342  (± 3.6%) i/s -      1.122k in   5.053040s
+    parse - big query      1.670k (± 5.3%) i/s -      8.496k in   5.103380s

As well as less memory:

- Total allocated: 498928 bytes (8187 objects)
+ Total allocated: 318544 bytes (3570 objects)

Base automatically changed from ragel-c-gen to master March 10, 2023 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant