DEV Community

Samanvi Thota
Samanvi Thota

Posted on

3 2

Performance Measurement

Performance Measurement: It is based on space and time requirements of a particular algorithm. These quantities depend on the compiler and options used, and the system on which the algorithm runs. The space and time needed for compilation are important during program testing. To obtain the run time of a program, we need a clocking procedure. We assume the existence of a program GetTime() that returns the current time in milliseconds.

Suppose if we want to measure the worst-case performance of the sequential search algorithm
we need to follow these:
1.decide on the values of n for which the times are to be obtained
2.determine for each of the above values of the data that exhibit the worst-case behavior.

Algorithm:
SeqSearch(a,x,n)
//search for x in a[1:n]. a[0] is used as additional space.
{
i:=n; a[0] :=x;
while (a[i]=!x) do i := i-1;
return i;
}

click here, for more detailed explanation with example

Image of Datadog

Create and maintain end-to-end frontend tests

Learn best practices on creating frontend tests, testing on-premise apps, integrating tests into your CI/CD pipeline, and using Datadog’s testing tunnel.

Download The Guide

Top comments (1)

Collapse
 
guntakalikhitha profile image
Likhitha Guntaka

Good

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay