News for hackers. Stuff that matters.
Re:Ruby Outperforms C: Breaking the Catch-22 by vidarh on Saturday September 09, 2023 @07:28AM (#37444164)
I think a parser is perhaps the example of where resorting to a compiled extension can be beaten by something more JIT-favourable.

In a language like Ruby it tends to be heavily dominated by scanning text, and creation of objects, and 1) you can often speed it up drastically by reducing object creation. E.g. here is Aaron writing about speeding up the GraphQL parser partly by doing that[1], 2) creating Ruby objects and building up complex structures in the C extension is going to be almost exactly as slow in the C extension as in the Ruby, 3) the scanning of the text mostly hits the regexp engine which is already written in C.

[1] https://tenderlovemaking.com/2023/09/02/fast-tokenizers-with...

There are no comments on this comment yet.