chevrotain
chevrotain copied to clipboard
Removing IToken.tokenTypeIdx in favor of IToken.tokenType.tokenTypeIdx
As discussed on gitter, creating an issue for it so I don't forget.
Are there performance reasons for tokenTypeIdx being a separate property instead of using tokenType.tokenTypeIdx?
the *Idx property was there initially, the tokenType was added for debug reasons. this creates a bit of duplication... It may be slightly faster to access the Idx directly instead of itok.tokenType.tokenTypeIdx. It may be worth investigating the removal of tokenTypeIdx in favor of only tokenType and measure the performance difference. There is a comparative benchmark in https://github.com/SAP/chevrotain/tree/master/packages/chevrotain/benchmark_web to test performance changes between different versions of Chevrotain. if the regression is small (1-3%) we can evaluate this model simplification.
@bd82 Is it possible for you to assign me to this issue or do I need to be a member of the repository for that?
Is it possible for you to assign me to this issue or do I need to be a member of the repository for that?