Skip to content

Commit 360b6bb

Browse files
committed
profiler tests must all be under 4 seconds
1 parent f1aea9d commit 360b6bb

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

rewrite/src/profiler/benchmark.h

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ void RunTest_RW_COLL_PPTE_STACK()
1717
SVec3 v2 = {0xFD00, 0x2EC, 0xEA58};
1818
SVec3 point = {0xFD6F, 0x2F5, 0xEDCE};
1919

20-
// million
21-
for(int i = 0; i < 1000000; i++)
20+
// 100,000
21+
for(int i = 0; i < 100000; i++)
2222
{
2323
COLL_ProjectPointToEdge(&out, &v1, &v2, &point);
2424
}
@@ -38,8 +38,8 @@ void RunTest_ND_COLL_PPTE_STACK()
3838
SVec3 v2 = {0xFD00, 0x2EC, 0xEA58};
3939
SVec3 point = {0xFD6F, 0x2F5, 0xEDCE};
4040

41-
// million
42-
for(int i = 0; i < 1000000; i++)
41+
// 100,000
42+
for(int i = 0; i < 100000; i++)
4343
{
4444
ND_COLL_ProjectPointToEdge(&out, &v1, &v2, &point);
4545
}
@@ -70,8 +70,8 @@ void RunTest_RW_COLL_PPTE_SCRATCH()
7070
point->v[1] = 0x2F5;
7171
point->v[2] = 0xEDCE;
7272

73-
// million
74-
for(int i = 0; i < 1000000; i++)
73+
// 100,000
74+
for(int i = 0; i < 100000; i++)
7575
{
7676
COLL_ProjectPointToEdge(out, v1, v2, point);
7777
}
@@ -102,15 +102,19 @@ void RunTest_ND_COLL_PPTE_SCRATCH()
102102
point->v[1] = 0x2F5;
103103
point->v[2] = 0xEDCE;
104104

105-
// million
106-
for(int i = 0; i < 1000000; i++)
105+
// 100,000
106+
for(int i = 0; i < 100000; i++)
107107
{
108108
ND_COLL_ProjectPointToEdge(out, v1, v2, point);
109109
}
110110

111111
ND_printf("Done\n");
112112
}
113113

114+
// 15720 = 1 second
115+
// Note: Every test MUST be less than 4 seconds,
116+
// because after 65535, the counter resets itself
117+
114118
// Always run RW (rewrite) before OG (original)
115119
struct BenchTest tests[] =
116120
{

rewrite/src/profiler/profiler.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,13 +129,9 @@ void RunTest()
129129
ND_howl_Disable();
130130

131131
ND_EnterCriticalSection();
132-
133132
ND_ResetRCnt(0xf2000001);
134-
ND_printf("%d\n", ND_GetRCnt(0xf2000001));
135133
tests[testIndex].funcPtr();
136134
tests[testIndex].val = ND_GetRCnt(0xf2000001);
137-
ND_printf("%d\n", ND_GetRCnt(0xf2000001));
138-
139135
ND_ExitCriticalSection();
140136

141137
testIndex++;

0 commit comments

Comments
 (0)