evanphx/kpeg — Issue #22: Relatively slow performance
Author: wycats
Created: 2012-01-17 18:15:16+00:00
State: open

I have written a JavaScript parser (wycats/parsejs) using kpeg, and get between 15k and 30k bytes per second when parsing JavaScript files. This seems slow and it would be nice to be figure out a way to improve performance.

There is a good sample file in the fixtures in the ParseJS at https://github.com/wycats/parsejs/blob/master/spec/fixtures/sizzle.js

Here's a simple benchmark:

```ruby
require "benchmark"
require "parsejs"

parser = ParseJS::Parser.new(File.read("spec/fixtures/sizzle.js"))

Benchmark.bm do |x|
x.report("sizzle") { parser.parse }
end
```