Week 8: Measuring The Execution Time of a Program
May 8, 2026
As you know from my past blogs, the goal of my project is to develop an ultra-fast implementation of an advanced mathematics algorithm – Additive NTT with the usage of a graphics processing unit (GPU).
But if our goal is optimization, how do we measure the time it takes for a program to run? There are many different ways to do this in the computer world, but there is one specific way to measure time accurately in order to find bottlenecks in such a complex system. There are three components we need to consider:
1. To measure the time it takes to do the calculations, we need to use CUDA events. It measures the execution time of the program exclusively on the GPU.
2. The time it takes for the data to be transferred from the GPU to the CPU, and vice versa. This should be measured separately, since the speed of calculations is worthless if the time of data transfer is too high! This allows us to know if the time taken to transfer data is too large.
3. The last thing we need is a profiler called Nsight Systems. It will give us a detailed analysis and tell us where the slowest parts of our program are.

Leave a Reply
You must be logged in to post a comment.