SublimeText / PackageDev

Tools to ease the creation of snippets, syntax definitions, etc. for Sublime Text.
MIT License
436 stars 83 forks source link

Remove some unnecessary captures. #148

Closed deathaxe closed 7 years ago

deathaxe commented 7 years ago

Captures take some time to be handled and thus should be avoided where possible.

keith-hall commented 7 years ago

Actually it's a fairly simple optimization to ignore captures if none of the captures in the expression are used - syntect does this, for example.

deathaxe commented 7 years ago

ST seems not. I did several benchmarks with my CNC package. It turned out avoiding captures can easily increase performance by 10 to 15%.

FichteFoll commented 7 years ago

I believe it is misleading to use captures without the intend of actually capturing them, regardless of runtime performance, so thanks for that.

FichteFoll commented 7 years ago

Merged (and rebased) as e5cc2dd50968d5ac89136602c71d636582389878.