Home GnuPG

Make phutil_tag() / phutil_escape_html() 10-15% faster
70abbd8811b2Unpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

Description

Make phutil_tag() / phutil_escape_html() 10-15% faster

Summary:
These numbers are a bit rough, but they seem to make a difference. Total weight of my test page (Maniphest task list) dropped from ~194ms to ~170ms. Time spent in phutil_tag() dropped from 105-110ms to 90ms.

This also cleans up the call graph for xhprof a bit (e.g., removes 1,300 calls to array_map()). Generally, foreach(...) is faster than array_map(...) (at least for small inputs, and at least on Zend PHP) as we avoid paying for function call overhead.

Test Plan: Loaded various pages. There should be no functional changes.

Reviewers: btrahan, chad, vrana

Reviewed By: chad

CC: aran

Differential Revision: https://secure.phabricator.com/D6183

Details

Provenance
epriestley <git@epriestley.com>Authored on Jun 12 2013, 3:17 PM
Parents
rPHUTIL8161f709c4f0: Improve performance of phutil_utf8_shorten()
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPHUTIL70abbd8811b2: Make phutil_tag() / phutil_escape_html() 10-15% faster (authored by epriestley <git@epriestley.com>).Jun 12 2013, 3:17 PM