How to measure the optimized time between android-app using pipelineCache and not?

how to measure the optimized time between android-app using pipelineCache and not?

  1. use .spv
  2. use pipelineCace
    how to measure the CPU and GPU time of the above 2 methods
    Thanks!
1 Like

Dear @gpu22

Great question! Measuring the impact of VkPipelineCache is all about timing the pipeline creation phase. You’re not benchmarking frame rate here, but how long it takes to build pipelines during app startup or scene load.

A simple way to do this:

  • Without cache: Run your app cold, create pipelines from scratch, and log the time from vkCreateGraphicsPipelines.
  • With cache: Load a previously saved cache via vkCreatePipelineCache, then create the same pipelines and log again.

You can wrap the pipeline creation call with a timestamp like this:

auto start = std::chrono::high_resolution_clock::now();
vkCreateGraphicsPipelines(...);
auto end = std::chrono::high_resolution_clock::now();
auto duration = std::chrono::duration_cast<std::chrono::milliseconds>(end - start).count();
std::cout << "Pipeline creation took " << duration << " ms\n";

On Android, you might also want to log to logcat or use systrace to visualize startup time.
Just remember: pipeline cache helps reduce creation time, but only if the cache is valid and reused correctly. Always check return values and make sure the cache file is actually being loaded.

~p3nGu1nZz

PS. if you want even more accurate i highly suggest checking out VALVe’s SDL2 lib which has get performance timing for even better precision

1 Like