Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Less_Parser: Inline and optimize heavily called MatchQuoted()
The method was not used anywhere else and can as well be inlined. This does have an actual effect in real-world scenarios. On my local machine, MediaWiki's ResourcesTest (parses hundreds of Less files in PHPUnit) runs approx. 8% faster just because of this change. Some details: * Function call overhead is surprisingly significant in PHP. This method was called 200,000 times. This adds up. * The main change is the initial check for the first character. This succeeds in about 50% of the cases where everything below can be skipped. * Inlining the code makes some more minor adjustments and optimizations possible. * The $isEscaped code path is super rare and should be skipped as fast as possible if it doesn't apply. Bug: T225730 Change-Id: Ie7c31f375ea99fb38e61b60eb99dbbd505315ec8
- Loading branch information