Skip to content
This repository has been archived by the owner on May 26, 2023. It is now read-only.

Performance #71

Closed
cdthompson opened this issue Apr 20, 2018 · 5 comments
Closed

Performance #71

cdthompson opened this issue Apr 20, 2018 · 5 comments
Assignees

Comments

@cdthompson
Copy link

Running wist on my 2013 Macbook, it takes ~14s for wist to lint a 200-line BRS file. This is a lot longer than I expected but I don't have much experience with antlr.

Does this seem in line with performance you guys are seeing? If not, any hints on where I should start to isolate bottlenecks?

@nishtahir
Copy link
Member

Thanks for sharing your feedback. We have been experiencing similar performance issues as well although not quite as bad as what you are seeing.

A roughly 500 line *.brs takes 12.06s on a similar Macbook pro.

The root cause seems to be mostly associated with the antlr JS runtime just being much slower than other platforms or possibly some optimizations we can make in the grammar

antlr/antlr4#1540

One option I plan on investigating is to compile the grammar for a C++ target and cross compile it to a wasm module as mentioned here

antlr/antlr4#1375

Any thoughts? @vannuysm

@cdthompson
Copy link
Author

I did the minimum to get emscripten solution parsing, but didn't incorporate the listeners for linting rules. It brought the time for my above test case down to 2s but seems there's a lot of work to expose the listeners across the C++/JS boundary. For now I'm going to focus on using wist in a CI environment exclusively, then perhaps later come back to helping improve this. I'll leave this issue open and let you both decide whether to track it or close.

@nishtahir
Copy link
Member

I did mostly the same thing here. My results were similar to yours with ~1.5s to parse a 1000 line*.brs file. I'm currently in the process of writing a wrapper around the generated ANTLR AST so we can plugin the rules engine.

@nishtahir nishtahir self-assigned this Apr 30, 2018
@nishtahir
Copy link
Member

So far we have some parts of wist ported over to use emscripten. i've created a branch experimental/web-assembly-parser for this.

@cdthompson
Copy link
Author

Thanks for this effort

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants