Improve SingletonThreadLocal performance
authorYedidya Feldblum <yfeldblum@fb.com>
Thu, 18 Jan 2018 22:49:00 +0000 (14:49 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Thu, 18 Jan 2018 23:12:30 +0000 (15:12 -0800)
commit6374f552672fe630d7060937593c1982be448b87
tree63ffac0933cf7536016cc37fcc4f63bde2daafb9
parente96129da65d3ad2b20aae5a2bf2d22d2d72b8feb
Improve SingletonThreadLocal performance

Summary:
[Folly] Improve `SingletonThreadLocal` performance.

By explicitly controlling inlining behavior.

The ctor is definitionally cold - once per process - so outline.

`get` is hot so inline. Uncached `get` is cold - once per thread - so outline uncached.

Reviewed By: djwatson

Differential Revision: D6736662

fbshipit-source-id: 4cd77c7772b46e2e3c6b2a3dc071b2b06522979e
folly/SingletonThreadLocal.h