forked from facebook/hhvm
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Perf/HPHPi] optimize constant lookup
Summary: HPHPi constant look up was slow, I made changes to speed up that by (1) detecting builtin constant at parse time (2) add findUserConstant without looking up the builtin constant table further (3) changed m_constant to StringData and use StaticString to speed up the lookup/comparison Test Plan: make fast_tests make slow_tests micro benchmark: <?php define('FOO', 1); function foo() { $sum = 0; for ($i = 1; $i < 50000000; $i++) { $sum += FOO; } return $sum; } var_dump(foo()); Before: real 0m19.038s user 0m18.980s sys 0m0.048s After: real 0m9.002s user 0m8.973s sys 0m0.037s Reviewed By: stephentu Reviewers: mwilliams, qigao, stephentu CC: hphp-diffs@lists, ps, mwilliams, stephentu Revert Plan: Tags: - begin *PUBLIC* platform impact section - Bugzilla: # - end platform impact - Differential Revision: 307167
- Loading branch information
myang
authored and
macvicar
committed
Aug 19, 2011
1 parent
2df1ef6
commit 1a09996
Showing
8 changed files
with
83 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters