|
Ran
|
Files
86
|
Run time
5s
|
Badge
README BADGES
|
push
travis-ci
Don't process token attributes unnecessarily * The async flag is false in AttributeTransformManager only when the attributes of the token being processed won't get updated or expanded. * Given that, there is no reason going async and then rebuilding new attributes. Based on some logging, I found that > 60% of tokens went through buildExpandedAttrs even though ~1% of all tokens actually got their attributes updated. Accordingly, juggled around some yield/async logic to bypass the buildExpandedAttrs method altogether where possible. * Eliminated unnecessary promise creation from the common case path where the attributes come through unchanged. So, I moved back from async/yield to promises in AttributeExpander.onToken (and TemplateHandler.onTemplate just to be consistent). * Together, the previous two optimizations lead to significant perf improvement. On enwiki:Berlin, went from 8.3s -> 8.1s -> 7.9s on my laptop parserTests complete faster as well. * There is another source of inefficiency lurking around still that will be addressed later. While the 60% of tokens now bypass buildExpandedAttrs, they still go through AttributeTransformManager.process and build a new key-value array that is not actually used. It would be useful to skip that as well in a subsequent patch. Change-Id: I2e8d90dcc
8910 of 10955 branches covered (81.33%)
14250 of 16555 relevant lines covered (86.08%)
25512.21 hits per line
| Coverage | ∆ | File | Lines | Relevant | Covered | Missed | Hits/Line | Branch Hits | Branch Misses |
|---|