Closed
Description
Hey,
The python3 antlr runtime spend a large proportion of its import load time importing unittest
.
This can profiled with pythons newish -X importtime
option.
importtime.txt
My on system it takes ~150ms to import antlr4
and ~100ms of that time is spent importing unittest
.
This seems to be like quite a high time cost to pay just the keep the tests inline with the source.
My current project involing creating a python command line tool, which utilises antlr, and I would ideally like to keep the startup time as low as possible.
Would you consider moving the unitests out of the source tree?
Cheers,
Rob
Metadata
Metadata
Assignees
Labels
No labels
Activity
ericvergnaud commentedon Sep 14, 2020
Hi,
sure please submit a PR
rmcgregor1990 commentedon Sep 14, 2020
Upon further investigation it appears the tests defined within the
src
tree files are not even run as part of you're test suite.The only tests run are defined in
TestTokenStreamRewriter.py
in thetest
tree.I'll put together a PR.
ericvergnaud commentedon Sep 15, 2020
ericvergnaud commentedon Sep 15, 2020