File: KernelIteration_bench.C

package info (click to toggle)
ball 1.5.0%2Bgit20180813.37fc53c-11.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 239,928 kB
  • sloc: cpp: 326,149; ansic: 4,208; python: 2,303; yacc: 1,778; lex: 1,099; xml: 958; sh: 322; javascript: 164; makefile: 88
file content (54 lines) | stat: -rw-r--r-- 1,220 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// -*- Mode: C++; tab-width: 2; -*-
// vi: set ts=2:
//
// $Id: KernelIteration_bench.C,v 1.3 2002/02/27 12:20:32 sturm Exp $
#include <BALLBenchmarkConfig.h>
#include <BALL/CONCEPT/benchmark.h>

///////////////////////////

#include <BALL/KERNEL/system.h>
#include <BALL/FORMAT/PDBFile.h>

///////////////////////////

using namespace BALL;

START_BENCHMARK(KernelIteration, 1.0, "$Id: KernelIteration_bench.C,v 1.3 2002/02/27 12:20:32 sturm Exp $")

/////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////

PDBFile infile(BALL_BENCHMARK_DATA_PATH(AmberFF_bench.pdb));
System S;
infile >> S;
infile.close();

START_SECTION(ResidueIteration, 0.3)

	for (int count = 0; count < 10000; count++)
	{
		START_TIMER
			ResidueIterator res_it = S.beginResidue();
			for (; +res_it; ++res_it);
		STOP_TIMER
	}

END_SECTION

START_SECTION(AtomIteration, 0.7)

	for (int count = 0; count < 10000; count++)
	{
		START_TIMER
			AtomIterator res_it = S.beginAtom();
			for (; +res_it; ++res_it);
		STOP_TIMER
	}

END_SECTION

/////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////

END_BENCHMARK