LunarG / vktrace

Vulkan vktrace / vkreplay
Other
6 stars 8 forks source link

vkreplay: too many hash tables in the replayer #6

Open jyangsh opened 5 years ago

jyangsh commented 5 years ago

There are many hash tables(std::unordered_map) for remapping the vulkan handles in the replayer. That is causing cpu-bound in some case. From the profile data below, the most cpu time consumed by vkreplay is for remapping the vulkan handles. Is there any plan for improving the cpu overload in vkreplay?

[Process]/{Thread}/Code Total Self % Self Process % Process
[com.example.vkreplay #6150] 12.24%       100.00%
vkReplay::manually_replay_vkUpdateDescriptorSets(packet_vkUpdateDescriptorSets*) 0.42% 158 0.70% 765 3.40%
std::ndk1::hash_table<std::ndk1::hash_value_type<VkDescriptorSet_T, VkDescriptorSet_T>, std::ndk1::unordered_map_hasher<VkDescriptorSet_T, std::ndk1::hash_value_type<VkDescriptorSet_T, VkDescriptorSet_T>, std::__ndk1::hash<VkDescriptorSet_T>, (bool)1>, std::ndk1::unordered_map_equal<VkDescriptorSet_T, std::ndk1::hash_value_type<VkDescriptorSet_T, VkDescriptorSet_T>, std::__ndk1::equal_to<VkDescriptorSet_T>, (bool)1>, std::ndk1::allocator<std::ndk1::hash_value_type<VkDescriptorSet_T, VkDescriptorSet_T>>>::find<VkDescriptorSet_T*>(std::ndk1::hash_iterator<std::ndk1::__hash_node<std::ndk1::hash_value_type<VkDescriptorSet_T, VkDescriptorSet_T>, void>>, const T1&) 0.19% 343 1.52% 343 1.52%
std::ndk1::hash_table<std::ndk1::hash_value_type<VkImageView_T, VkImageView_T>, std::ndk1::unordered_map_hasher<VkImageView_T, std::ndk1::hash_value_type<VkImageView_T, VkImageView_T>, std::__ndk1::hash<VkImageView_T>, (bool)1>, std::ndk1::unordered_map_equal<VkImageView_T, std::ndk1::hash_value_type<VkImageView_T, VkImageView_T>, std::__ndk1::equal_to<VkImageView_T>, (bool)1>, std::ndk1::allocator<std::ndk1::hash_value_type<VkImageView_T, VkImageView_T>>>::find<VkImageView_T*>(std::ndk1::hash_iterator<std::ndk1::__hash_node<std::ndk1::hash_value_type<VkImageView_T, VkImageView_T>, void>>, const T1&) 0.07% 122 0.54% 122 0.54%
std::ndk1::hash_table<std::ndk1::hash_value_type<VkBuffer_T, _bufferObj>, std::ndk1::unordered_map_hasher<VkBuffer_T, std::ndk1::hash_value_type<VkBuffer_T, _bufferObj>, std::__ndk1::hash<VkBuffer_T>, (bool)1>, std::ndk1::unordered_map_equal<VkBuffer_T, std::ndk1::hash_value_type<VkBuffer_T, _bufferObj>, std::ndk1::equal_to<VkBuffer_T*>, (bool)1>, std::ndk1::allocator<std::ndk1::hash_value_type<VkBuffer_T, _bufferObj>>>::find<VkBuffer_T>(std::ndk1::hash_iterator<std::ndk1::hash_node<std::ndk1::hash_value_type<VkBuffer_T, _bufferObj>, void>*>, const T1&) 0.04% 65 0.29% 65 0.29%
.plt [libvkreplay.so] 0.02% 43 0.19% 43 0.19%
std::ndk1::hash_table<std::ndk1::hash_value_type<VkSampler_T, VkSampler_T>, std::ndk1::unordered_map_hasher<VkSampler_T, std::ndk1::hash_value_type<VkSampler_T, VkSampler_T>, std::__ndk1::hash<VkSampler_T>, (bool)1>, std::ndk1::unordered_map_equal<VkSampler_T, std::ndk1::hash_value_type<VkSampler_T, VkSampler_T>, std::__ndk1::equal_to<VkSampler_T>, (bool)1>, std::ndk1::allocator<std::ndk1::hash_value_type<VkSampler_T, VkSampler_T>>>::find<VkSampler_T*>(std::ndk1::hash_iterator<std::ndk1::__hash_node<std::ndk1::hash_value_type<VkSampler_T, VkSampler_T>, void>>, const T1&) 0.01% 24 0.11% 24 0.11%
std::ndk1::hash_table<std::ndk1::hash_value_type<VkDevice_T, VkDevice_T>, std::ndk1::unordered_map_hasher<VkDevice_T, std::ndk1::hash_value_type<VkDevice_T, VkDevice_T>, std::__ndk1::hash<VkDevice_T>, (bool)1>, std::ndk1::unordered_map_equal<VkDevice_T, std::ndk1::hash_value_type<VkDevice_T, VkDevice_T>, std::__ndk1::equal_to<VkDevice_T>, (bool)1>, std::ndk1::allocator<std::ndk1::hash_value_type<VkDevice_T, VkDevice_T>>>::find<VkDevice_T*>(std::ndk1::hash_iterator<std::ndk1::__hash_node<std::ndk1::hash_value_type<VkDevice_T, VkDevice_T>, void>>, const T1&) < 0.01% 9 0.04% 9 0.04%
std::ndk1::hash_table<std::ndk1::hash_value_type<VkBufferView_T, VkBufferView_T>, std::ndk1::unordered_map_hasher<VkBufferView_T, std::ndk1::hash_value_type<VkBufferView_T, VkBufferView_T>, std::__ndk1::hash<VkBufferView_T>, (bool)1>, std::ndk1::unordered_map_equal<VkBufferView_T, std::ndk1::hash_value_type<VkBufferView_T, VkBufferView_T>, std::__ndk1::equal_to<VkBufferView_T>, (bool)1>, std::ndk1::allocator<std::ndk1::hash_value_type<VkBufferView_T, VkBufferView_T>>>::find<VkBufferView_T*>(std::ndk1::hash_iterator<std::ndk1::__hash_node<std::ndk1::hash_value_type<VkBufferView_T, VkBufferView_T>, void>>, const T1&) < 0.01% 1 < 0.01% 1 < 0.01%