Commit 6c822a8a authored by Matthieu Martin's avatar Matthieu Martin Committed by Facebook Github Bot

RequestContext: replace F14FastMap by std::unordred_map

Summary: Production data shows that it performs significantly worse under common RequestContext load (few elements, clang lto compiled).

Reviewed By: djwatson

Differential Revision: D9182929

fbshipit-source-id: 0c638268d9b6cd2451b48ccc4e228faf90f0e18e
parent e0d38a26
...@@ -16,12 +16,12 @@ ...@@ -16,12 +16,12 @@
#pragma once #pragma once
#include <folly/container/F14Map.h>
#include <folly/sorted_vector_types.h>
#include <memory> #include <memory>
#include <string> #include <string>
#include <unordered_map>
#include <folly/Synchronized.h> #include <folly/Synchronized.h>
#include <folly/sorted_vector_types.h>
namespace folly { namespace folly {
...@@ -169,7 +169,7 @@ class RequestContext { ...@@ -169,7 +169,7 @@ class RequestContext {
struct State { struct State {
// This must be optimized for lookup, its hot path is getContextData // This must be optimized for lookup, its hot path is getContextData
F14FastMap<std::string, RequestData::SharedPtr> requestData_; std::unordered_map<std::string, RequestData::SharedPtr> requestData_;
// This must be optimized for iteration, its hot path is setContext // This must be optimized for iteration, its hot path is setContext
// We also use the fact that it's ordered to efficiently compute // We also use the fact that it's ordered to efficiently compute
// the difference with previous context // the difference with previous context
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment