1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-10 08:52:39 +01:00
No description
Find a file
epriestley 7831b92427 Improve LiskDAO::__call() performance
Summary:
This is kind of expensive and can be significant on, e.g., the
Maniphest task list view. Do a little more caching and some clever nonsense to
improve performance.

Test Plan:
Local cost on Maniphest "all tasks" view for this method dropped from
##82,856us## to ##24,607us## on 9,061 calls.

I wrote some unit test / microbenchmark things:

  public function testGetIDCost() {
    $u = new PhabricatorUser();
    $n = 100000;
    while ($n--) {
      $u->getID();
    }
    $this->assertEqual(1, 1);
  }

  public function testGetCost() {
    $u = new PhabricatorUser();
    $n = 100000;
    while ($n--) {
      $u->getUsername();
    }
    $this->assertEqual(1, 1);
  }

  public function testSetCost() {
    $u = new PhabricatorUser();
    $n = 100000;
    while ($n--) {
      $u->setID(1);
    }
    $this->assertEqual(1, 1);
  }

Before:

   PASS  598ms   testSetCost
   PASS  584ms   testGetCost
   PASS  272ms   testGetIDCost

After:

   PASS  170ms   testSetCost
   PASS  207ms   testGetCost
   PASS   29ms   testGetIDCost

Also, ran unit tests.

Reviewers: nh, btrahan, jungejason

Reviewed By: nh

CC: aran, epriestley, nh

Differential Revision: https://secure.phabricator.com/D1291
2012-01-03 22:03:34 -08:00
bin Improve CLI script for account creation and document account/reg setup process 2011-05-12 18:44:53 -07:00
conf Turn on syntax highlight for .arcconfig 2011-12-23 23:35:02 -08:00
externals Update Javelin; improve package definitions 2011-12-20 08:27:54 -08:00
resources Make tracked git repositories use an implicit 'origin' remote 2011-12-29 08:35:32 -08:00
scripts Document how to use the symbol importer 2011-12-22 06:45:59 -08:00
src Improve LiskDAO::__call() performance 2012-01-03 22:03:34 -08:00
support/aphlict Aphlict, simple notification server 2011-05-17 10:32:41 -07:00
webroot Re-set timeout in ShapedRequest on rate-limit conditions 2011-12-28 16:15:46 -08:00
.arcconfig Add a custom lint name hook to Phabricator 2011-08-31 13:49:30 -07:00
.divinerconfig Some documentation updates. 2011-09-14 08:02:31 -07:00
.gitignore Key Value Store for ManiphestTask 2011-07-25 19:11:55 -07:00
.gitmodules Just change the location. 2011-05-28 15:14:54 -07:00
README Add a roadmap document and update the README. 2011-06-29 09:38:03 -07:00

Phabricator is a open source collection of web applications which make it easier
to write, review, and share source code. Phabricator was developed at Facebook.

This is an early release. It's pretty high-quality and usable, but under
active development so things may change quickly.

You can learn more about the project and find links to documentation and
resources at: http://phabricator.org/

LICENSE

Phabricator is released under the Apache 2.0 license except as otherwise noted.
http://www.apache.org/licenses/LICENSE-2.0