canopy
canopy copied to clipboard
Question about Improving a grammar
Hi there! So I'm really new to grammar and canopy as well. I wrote this PEG file based on several things that I read and the online resources. However, it seems that the final result (I'm using Ruby as the output) is not performing very well. Does anyone know if there is was for me to improve its performance?
https://gist.github.com/crashtech/721a2258335d0d8f7e5a399a58ebc4aa
Have a look here https://github.com/jcoglan/canopy/issues/65
@crashtech I'm not able to comment on the specifics of that grammar. Do you have an example of a benchmark (e.g. using benchmark/ips) to demonstrate the poor performance you're seeing? Have you tried implementing the same grammar in other Ruby PEG toolkits?
The best advice I'm able to give is to analyse your program using ruby-prof to find out where it's spending its time.