{"action":"opened","issue":{"url":"https://api.github.com/repos/Hardmath123/nearley/issues/111","repository_url":"https://api.github.com/repos/Hardmath123/nearley","labels_url":"https://api.github.com/repos/Hardmath123/nearley/issues/111/labels{/name}","comments_url":"https://api.github.com/repos/Hardmath123/nearley/issues/111/comments","events_url":"https://api.github.com/repos/Hardmath123/nearley/issues/111/events","html_url":"https://github.com/Hardmath123/nearley/issues/111","id":167248743,"number":111,"title":"Very slow performance for JSON grammar.","user":{"login":"bd82","id":4233843,"avatar_url":"https://avatars.githubusercontent.com/u/4233843?v=3","gravatar_id":"","url":"https://api.github.com/users/bd82","html_url":"https://github.com/bd82","followers_url":"https://api.github.com/users/bd82/followers","following_url":"https://api.github.com/users/bd82/following{/other_user}","gists_url":"https://api.github.com/users/bd82/gists{/gist_id}","starred_url":"https://api.github.com/users/bd82/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bd82/subscriptions","organizations_url":"https://api.github.com/users/bd82/orgs","repos_url":"https://api.github.com/users/bd82/repos","events_url":"https://api.github.com/users/bd82/events{/privacy}","received_events_url":"https://api.github.com/users/bd82/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-07-24T19:07:52Z","updated_at":"2016-07-24T19:07:52Z","closed_at":null,"body":"Hello.\r\n\r\n### Background\r\nI'm trying to add nearley to a benchmark of multiple javascript parsing libraries.\r\nFor this purpose I've implemented a JSON grammar using nearley\r\nand have \"fed\" it my standard sample (±1,000 lines) json input.\r\n\r\n### Issue\r\nOn my modern MacBook Pro (4ghz I7) parsing this sample takes ±6-7 seconds.\r\nThis is as much as **three order of magnitudes** slower than other Parsing libraries I've used.\r\n\r\n[**Reproducing html page**](http://sap.github.io/chevrotain/performance/index_nearley.html\r\n)\r\n* This page prints the total parsing time to the **console**.\r\n* It may take a few seconds until the page is responsive to allow opening the development tools.\r\n\r\n### Sources:\r\n* [Grammar](https://github.com/SAP/chevrotain/blob/47f40b1f464bae834dad1af5cbe3654671b5f73b/performance/jsonParsers/nearley/json_grammar.ne)\r\n* [Generated Code](https://github.com/SAP/chevrotain/blob/47f40b1f464bae834dad1af5cbe3654671b5f73b/performance/jsonParsers/nearley/nearley_json_parser.js)\r\n* [benchmark code](https://github.com/SAP/chevrotain/blob/47f40b1f464bae834dad1af5cbe3654671b5f73b/performance/index_nearley.html#L22)\r\n* [1,000 lines sample input](https://github.com/SAP/chevrotain/blob/47f40b1f464bae834dad1af5cbe3654671b5f73b/performance/samples/1K_json_no_escaping.js)\r\n\r\n### Extra Details\r\nI'm even ignoring whitespace (pre-processing it out of the input) and literal string escaping handling to simplify the grammar. so its a strict subset of the JSON grammar which makes it **extremely** simple as the base JSON grammar is already quite simple...\r\n\r\n### Questions\r\n* Am I doing something incorrectly / missing something?\r\n* Should this be examined using a separate tokenizer as well?\r\n\r\nThanks.\r\n "}}
{"actor":{"display_login":"bd82"}}