Profiling

Danin Sudjono
PDB+R
Published in
2 min readMay 21, 2019
taken from a blog from progress.com

What’s poppin’, good readers of our Medium. It’s ya boy Danin again back at it this time with materials on profiling. Code profiling is an important practice in software development. Interested to find out why?

What is profiling and why?

According to Wikipedia (not the best source but enough to give a rough description), profiling is used for optimizing our program. There are many ways to do this, such as analyzing space or time complexity. Profiling can be achieved straight from the code or from a standalone tool called a profiler.

Our Implementation

Our group uses a Python library called time to profile some functions in our code. Simply by comparing the internal clock at the start and the end of a function, we can see how long it takes to run said function. In the image below, I attempt to check the runtime of two functions: The Auto-create Term function, and the Activate Term function.

Runtime speed using time library

We can see that the runtime needed for both these functions are quite fast, averaging around 0.1–0.2 seconds.

Long story short, profiling is definitely necessary if we want our code to be optimized. By evaluating our code performance, we can figure out the problems that lie within our code and refactor in order to make it run smoothly.

--

--