# Updating instance custom data each frame is slow. Any way to make it faster?

**URL:** <https://forums.unrealengine.com/t/updating-instance-custom-data-each-frame-is-slow-any-way-to-make-it-faster/593376>\
**Category:** C++\
**Tags:** GPU-Profiling, unreal-engine, Performance, UE5-0, question\
**Created:** [June 29, 2022, 1:46pm UTC](https://forums.unrealengine.com/t/updating-instance-custom-data-each-frame-is-slow-any-way-to-make-it-faster/593376 "2022-06-29T13:46:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kurzemnieks](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/kurzemnieks/32/1125481_2.png) [@kurzemnieks](https://forums.unrealengine.com/u/kurzemnieks)\
**Post date:** [June 29, 2022, 1:46pm UTC](https://forums.unrealengine.com/t/updating-instance-custom-data-each-frame-is-slow-any-way-to-make-it-faster/593376/1 "2022-06-29T13:46:37Z")

</div>

I have a crowd system with ~20k people. It’s based on Hierarchical Instanced Static Mesh component and using bone animation baked to textures.  
It is running quite fast, but I want to update Custom Float Data each frame for each instance and it does give significant performance drop. I need to update couple dynamic parameters each frame, that I’m using in vertex shader for animation blending/playback.  
I don’t exactly understand how it works lowe level, but I understand data needs to be copied to GPU when changed and it is probably not very fast, but I was hoping the performance hit would not be so big (From 85 Fps to 45 Fps).  
I tried profiling with Unreal Insights, but only slow function I found was PrepareFistanceFieldScene. I don’t have any distance fields in the scene and scene is empty (just the crowd). So it’s probably waiting on something else.

So my question is - is there anything that can be done to improve custom data update? How do I properly profile it? Maybe there is another way to pass data to shader in a faster way?  
I was also trying to do this through Niagara and using CustomMaterialParameters and I think it was working faster.
