After an upgrade from 20.9 to 21.5 the system's performance became horrible.
It looks related to dictGet calls.
We use dictionaries extensively, some queries call dictGet billions of times.
This query shows the timings for one type of queries during the upgrade day (max_execution_time is set to 900 seconds):
```
select ...
from cluster(segmented,system,query_log) 
where event_date = '2021-06-02' and type>1
and normalizeQuery(query) like '?'
order by query_duration_ms desc

revision | query_duration_ms | read_rows  
---------+-------------------+------------
   54450 |            897083 | 3459117378 
   54450 |            897014 | 3364998164 
   54450 |            897012 | 3299700894 
   54450 |            896979 | 3152379204 
   54450 |            896979 | 2702215145 
   54450 |            896964 | 3177876106 
   54450 |            896962 | 3474400555 
   54450 |            896958 | 3110768107 
   54450 |            896958 | 3110768107 
   54450 |            896955 | 2431164845 
   54450 |            896951 | 3256483636 
   54450 |            896951 | 3095311086 
   54450 |            896943 | 2642380771 
   54450 |            896940 | 2806694280 
   54450 |            896920 | 2519595244 
   54450 |            896109 | 3415702637 
   54450 |            896098 | 4081416581 
   54450 |            896090 | 3568601556 
   54450 |            896061 | 4020248971 
   54450 |            896035 | 4126625535 
   54450 |            892479 | 1712068430 
   54450 |            892455 | 1952843231 
   54450 |            892431 | 1773988056 
   54450 |            892430 | 2192413020 
   54450 |            892347 | 2100158081 
   54450 |            892339 | 1756340381 
   54450 |            892326 | 1674227229 
   54450 |            892320 | 2391544140 
   54450 |            892315 | 2140854925 
   54450 |            892277 | 2528340153 
   54450 |            892277 | 2137937751 
   54450 |            892269 | 2282153280 
   54450 |            892239 | 1980261024 
   54450 |            892170 | 1609459314 
   54450 |            892170 | 1609459314 
   54450 |            850833 | 4674872143 
   54450 |            844513 | 4662846798 
   54450 |            835782 | 4678629857 
   54450 |            821421 | 4664510731 
   54450 |            811417 | 4664635983 
   54450 |            810258 | 4671813792 
   54450 |            808047 | 4666613441 
   54450 |            791205 | 4681643817 
   54450 |            785817 | 4674652841 
   54450 |            311279 | 1111580518 
   54439 |             20446 | 4608220540 
   54439 |             20161 | 4606741306 
   54439 |             19823 | 4601688152 
   54439 |             18877 | 4594803842 
   54439 |             18386 | 4623632801 
   54439 |             16791 | 4644514747 
   54439 |             16741 | 4645854329 
   54439 |             16380 | 4654062155 
   54439 |             16307 | 4644366032 
   54439 |             16051 | 4654656590 
   54439 |             16020 | 4653820788 
   54439 |             15978 | 4663026174 
   54439 |             15751 | 4672618090 
   54439 |             15740 | 4672743806 
   54439 |             15732 | 4657023203 
   54439 |             15301 | 4668494064 
   54439 |             14786 | 4689708177 
   54439 |             14633 | 4659128226 
   54439 |             14027 | 4717231446 
   54439 |             13920 | 4720637148 
   54439 |             13502 | 4706140498 
   54439 |             13403 | 4708245560 
   54439 |             13399 | 4709977568 
   54439 |             13298 | 4704405057 
   54439 |             13163 | 4716129000 
   54439 |             12804 | 4716505118 
   54439 |             12796 | 4725167340 
```
The dictionary is wide and sparse:
```
length(attribute.names)     | 131
type                        | Hashed
bytes_allocated             | 223264064
element_count               | 2239707

select count(), min(key), median(key), max(key) from dictionary

count() | min(key) | median(key) | max(key)            
--------+----------+-------------+---------------------
  17097 |     5019 |      230417 | 18446744073709551615
```
I noticed that the number if context switches per second was very high while 21.5 was running

![image](https://user-images.githubusercontent.com/20357526/120867030-72027880-c567-11eb-8e60-e8ed069a363b.png)

I checked different versions, 21.1 is working fine, 21.2 is slow.
I was not able to reproduce this on synthetic data yet, but I'll continue to try.
const std::string & name, const Poco::Util::AbstractConfiguration & config,
        const std::string & key_in_config, const std::string & repository_name) const
{
    
    
    bool created_from_ddl = !repository_name.empty();
    return DictionaryFactory::instance().create(name, config, key_in_config, getContext(), created_from_ddl);
}
ExternalDictionariesLoader::DictPtr ExternalDictionariesLoader::getDictionary(const std::string & dictionary_name, ContextConstPtr local_context) const
{
    std::string resolved_dictionary_name = resolveDictionaryName(dictionary_name, local_context->getCurrentDatabase());
    return std::static_pointer_cast<const IDictionary>(load(resolved_dictionary_name));
}
ExternalDictionariesLoader::DictPtr ExternalDictionariesLoader::tryGetDictionary(const std::string & dictionary_name, ContextConstPtr local_context) const
{
    std::string resolved_dictionary_name = resolveDictionaryName(dictionary_name, local_context->getCurrentDatabase());
    return std::static_pointer_cast<const IDictionary>(tryLoad(resolved_dictionary_name));
}
void ExternalDictionariesLoader::reloadDictionary(const std::string & dictionary_name, ContextConstPtr local_context) const
{
    std::string resolved_dictionary_name = resolveDictionaryName(dictionary_name, local_context->getCurrentDatabase());
    loadOrReload(resolved_dictionary_name);
}
DictionaryStructure ExternalDictionariesLoader::getDictionaryStructure(const std::string & dictionary_name, ContextConstPtr query_context) const