Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Performance Tests of an Algorithm.

Status
Not open for further replies.

ajex

Member level 4
Joined
Nov 7, 2009
Messages
70
Helped
6
Reputation
12
Reaction score
6
Trophy points
1,288
Location
Sri lanka
Activity points
1,813
Hi All,
I need to measure a process time in c# for a algorithm and did a test as follow.

1. Setting the ProcessorAffinity mask of the process.
Process.GetCurrentProcess().ProcessorAffinity = new IntPtr(2); // make the process use the second core or processor which is usually less loaded than the first

2. Setting the process and thread priority.
Process.GetCurrentProcess().PriorityClass = ProcessPriorityClass.High; // Set process priority to high
Thread.CurrentThread.Priority = ThreadPriority.Highest; // Set thread priority as Highest

3. A period of 1000-1500 ms Warm Up for CPU cache and pipelines stabilization .
while (StopWatch.ElapsedMilliseconds() <= 1500) //CPU warm-up process for for CPU cache and pipelines stabilization. it runs around 1000ms-1500ms period
{
MyAlgorithm();
}

4. Restart the StopWatch.
5. Start MyAlgorithm();
6. After completed the process, Stop the stopwatch and get the elapsed time in Milliseconds.


My question is "should I use the same MyAlgorithm() to warm up process in above 3rd step, or we can use any process like a long for loop?"

that mean should I use the exactly same process which I'm going to measure process time for CPU warm Up process? or just can we use any process inside warm up while loop?

Thank you..
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top