Why occur frame drop when different size texture into worker.Exeucte?

I’m trying to use barracuda to translate style. when I use alway same size texture, alway can see same (or average) performance. but if I put an different size texture (like 512512 → 256256), I can still see result no problem, but that time occur serious frame drop. (about under 10%) why occur frame drop when different size texture into worker.Exeucte?

Hello @vlfkdydtk yes, some performance drop when changing input sizes would be expected.

There are a few things going on under the hood:

  • First off: when you change input, the intermediate layers will change size. So they require more memory.
    What we do is that during the first time the input changes, we re-allocate all of the model needed internal memory. So we don’t need to allocate things during runtime, saving perf on successive runs.
  • Secondly, and I’m assuming you are using a ComputePrecompiled worker for this. Depending on your input size, we might select different optimal shaders, this might trigger some re-computations of different things. Imply a hiccup on the first frame.

You could try using a Compute worker to avoid the potential pre-computations when your input changes to see if it helps

Let me know

1 Like

yes. I have use a ComputePrecompiled worker. after change worker type to Compute, I can get a better performance when change texture size. but because still there’s frame drop problem, I have to find out another way to increasing performane. anyway, thanks for your answer!

One way you could do is to have two workers. One for each input size, were you would do a dry run at the start of your application to cache and allocate everything correctly.