Use StringData for APC hash-map keys
commit1bfc74a3efae2c9a844a79849e4fe59b58f443da
authorShaunak Kishore <kshaunak@fb.com>
Wed, 9 Jun 2021 07:04:53 +0000 (9 00:04 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Wed, 9 Jun 2021 07:06:33 +0000 (9 00:06 -0700)
tree7dad1a0fa4e138edeb39389e50edebb3a3031cdf
parent6b063f22634369aac8885b4fa34dd4dd53532a50
Use StringData for APC hash-map keys

Summary: ConcurrentSharedStore and HotCache use const char* as their key, which results in duplicate copies of uncounted keys, redundant hash and equality computations, and weak typing (void casts everywhere). Use a StringData instead. If the input key isn't already an uncounted string, we turn it into one. We use pointer equality to save on lookups, which will help for static keys in particular.

Reviewed By: ricklavoie

Differential Revision: D28974867

fbshipit-source-id: 638635087ca6d40b0c365505d90a69fec38222a4
hphp/runtime/base/concurrent-shared-store.cpp
hphp/runtime/base/concurrent-shared-store.h