forked from zyantific/zydis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ZydisPerfTest.c
588 lines (513 loc) · 20.8 KB
/
ZydisPerfTest.c
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
/***************************************************************************************************
Zyan Disassembler Library (Zydis)
Original Author : Florian Bernd
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
***************************************************************************************************/
#include <inttypes.h>
#include <stddef.h>
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include <Zycore/API/Terminal.h>
#include <Zycore/LibC.h>
#include <Zydis/Zydis.h>
#if defined(ZYAN_WINDOWS)
# include <windows.h>
#elif defined(ZYAN_APPLE)
# include <mach/mach_time.h>
#elif defined(ZYAN_LINUX) || defined(ZYAN_SOLARIS)
# include <sys/time.h>
# include <pthread.h>
#elif defined(ZYAN_FREEBSD)
# include <sys/time.h>
# include <pthread.h>
# include <pthread_np.h>
#else
# error "Unsupported platform detected"
#endif
/* ============================================================================================== */
/* Colors */
/* ============================================================================================== */
/* ---------------------------------------------------------------------------------------------- */
/* Configuration */
/* ---------------------------------------------------------------------------------------------- */
#define COLOR_DEFAULT ZYAN_VT100SGR_FG_DEFAULT
#define COLOR_ERROR ZYAN_VT100SGR_FG_BRIGHT_RED
#define COLOR_VALUE_R ZYAN_VT100SGR_FG_BRIGHT_RED
#define COLOR_VALUE_G ZYAN_VT100SGR_FG_BRIGHT_GREEN
#define COLOR_VALUE_B ZYAN_VT100SGR_FG_CYAN
/* ---------------------------------------------------------------------------------------------- */
/* Global variables */
/* ---------------------------------------------------------------------------------------------- */
static ZyanBool g_vt100_stdout;
static ZyanBool g_vt100_stderr;
/* ---------------------------------------------------------------------------------------------- */
/* Helper macros */
/* ---------------------------------------------------------------------------------------------- */
/**
* Conditionally expands to the passed VT100 sequence, if `g_colors_stdout` is
* `ZYAN_TRUE`, or an empty string, if not.
*
* @param The VT100 SGT sequence.
*/
#define CVT100_OUT(sequence) (g_vt100_stdout ? (sequence) : "")
/**
* Conditionally expands to the passed VT100 sequence, if `g_colors_stderr` is
* `ZYAN_TRUE`, or an empty string, if not.
*
* @param The VT100 SGT sequence.
*/
#define CVT100_ERR(sequence) (g_vt100_stderr ? (sequence) : "")
/* ---------------------------------------------------------------------------------------------- */
/* ============================================================================================== */
/* Helper functions */
/* ============================================================================================== */
/* ---------------------------------------------------------------------------------------------- */
/* Time measurement */
/* ---------------------------------------------------------------------------------------------- */
#if defined(ZYAN_WINDOWS)
double counter_freq = 0.0;
ZyanU64 counter_start = 0;
static void StartCounter(void)
{
LARGE_INTEGER li;
if (!QueryPerformanceFrequency(&li))
{
ZYAN_FPRINTF(ZYAN_STDERR, "%sError: QueryPerformanceFrequency failed!%s\n",
CVT100_ERR(COLOR_ERROR), CVT100_ERR(ZYAN_VT100SGR_RESET));
exit(EXIT_FAILURE);
}
counter_freq = (double)li.QuadPart / 1000.0;
QueryPerformanceCounter(&li);
counter_start = li.QuadPart;
}
static double GetCounter(void)
{
LARGE_INTEGER li;
QueryPerformanceCounter(&li);
return (double)(li.QuadPart - counter_start) / counter_freq;
}
#elif defined(ZYAN_APPLE)
ZyanU64 counter_start = 0;
mach_timebase_info_data_t timebase_info;
static void StartCounter(void)
{
counter_start = mach_absolute_time();
}
static double GetCounter(void)
{
ZyanU64 elapsed = mach_absolute_time() - counter_start;
if (timebase_info.denom == 0)
{
mach_timebase_info(&timebase_info);
}
return (double)elapsed * timebase_info.numer / timebase_info.denom / 1000000;
}
#elif defined(ZYAN_LINUX) || defined(ZYAN_FREEBSD) || defined(ZYAN_SOLARIS)
struct timeval t1;
static void StartCounter(void)
{
gettimeofday(&t1, NULL);
}
static double GetCounter(void)
{
struct timeval t2;
gettimeofday(&t2, NULL);
double t = (t2.tv_sec - t1.tv_sec) * 1000.0;
return t + (t2.tv_usec - t1.tv_usec) / 1000.0;
}
#endif
/* ---------------------------------------------------------------------------------------------- */
/* Process & Thread Priority */
/* ---------------------------------------------------------------------------------------------- */
static void AdjustProcessAndThreadPriority(void)
{
#if defined(ZYAN_WINDOWS)
SYSTEM_INFO info;
GetSystemInfo(&info);
if (info.dwNumberOfProcessors > 1)
{
if (!SetThreadAffinityMask(GetCurrentThread(), (DWORD_PTR)1))
{
ZYAN_FPRINTF(ZYAN_STDERR, "%sWarning: Could not set thread affinity mask%s\n",
CVT100_ERR(ZYAN_VT100SGR_FG_YELLOW), CVT100_ERR(ZYAN_VT100SGR_RESET));
}
if (!SetPriorityClass(GetCurrentProcess(), REALTIME_PRIORITY_CLASS))
{
ZYAN_FPRINTF(ZYAN_STDERR, "%sWarning: Could not set process priority class%s\n",
CVT100_ERR(ZYAN_VT100SGR_FG_YELLOW), CVT100_ERR(ZYAN_VT100SGR_RESET));
}
if (!SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_TIME_CRITICAL))
{
ZYAN_FPRINTF(ZYAN_STDERR, "%sWarning: Could not set thread priority class%s\n",
CVT100_ERR(ZYAN_VT100SGR_FG_YELLOW), CVT100_ERR(ZYAN_VT100SGR_RESET));
}
}
#elif defined(ZYAN_LINUX) || defined(ZYAN_FREEBSD)
pthread_t thread = pthread_self();
#if defined(ZYAN_LINUX)
cpu_set_t cpus;
#else // FreeBSD
cpuset_t cpus;
#endif
CPU_ZERO(&cpus);
CPU_SET(0, &cpus);
if (pthread_setaffinity_np(thread, sizeof(cpus), &cpus))
{
ZYAN_FPRINTF(ZYAN_STDERR, "%sWarning: Could not set thread affinity mask%s\n",
CVT100_ERR(ZYAN_VT100SGR_FG_YELLOW), CVT100_ERR(ZYAN_VT100SGR_RESET));
}
#endif
}
/* ---------------------------------------------------------------------------------------------- */
/* ============================================================================================== */
/* Internal functions */
/* ============================================================================================== */
typedef struct TestContext_
{
ZydisDecoderContext context;
ZydisDecodedInstruction instruction;
ZydisDecodedOperand operands[ZYDIS_MAX_OPERAND_COUNT];
char format_buffer[256];
ZyanBool minimal_mode;
ZyanBool format;
ZyanBool tokenize;
} TestContext;
static ZyanU64 ProcessBuffer(const ZydisDecoder* decoder, const ZydisFormatter* formatter,
TestContext* context, const ZyanU8* buffer, ZyanUSize length)
{
ZyanU64 count = 0;
ZyanUSize offset = 0;
ZyanStatus status;
while (length > offset)
{
status = ZydisDecoderDecodeInstruction(decoder, &context->context, buffer + offset,
length - offset, &context->instruction);
if (status == ZYDIS_STATUS_NO_MORE_DATA)
{
break;
}
if (!context->minimal_mode && ZYAN_SUCCESS(status))
{
status = ZydisDecoderDecodeOperands(decoder, &context->context, &context->instruction,
context->operands, context->instruction.operand_count);
}
if (!ZYAN_SUCCESS(status))
{
ZYAN_FPRINTF(ZYAN_STDERR, "%sUnexpected decoding error. Data: ",
CVT100_ERR(COLOR_ERROR));
for (ZyanUSize i = 0; i < ZYAN_MIN(ZYDIS_MAX_INSTRUCTION_LENGTH,
length - offset); ++i)
{
ZYAN_FPRINTF(ZYAN_STDERR, "%02X ", (ZyanU8)buffer[offset + i]);
}
ZYAN_FPRINTF(ZYAN_STDERR, "%s\n", CVT100_ERR(ZYAN_VT100SGR_RESET));
ZYAN_ASSERT(ZYAN_FALSE);
exit(EXIT_FAILURE);
}
if (context->format)
{
if (context->tokenize)
{
const ZydisFormatterToken* token;
ZydisFormatterTokenizeInstruction(formatter, &context->instruction,
context->operands, context->instruction.operand_count_visible,
context->format_buffer, sizeof(context->format_buffer), offset, &token,
ZYAN_NULL);
} else
{
ZydisFormatterFormatInstruction(formatter, &context->instruction,
context->operands, context->instruction.operand_count_visible,
context->format_buffer, sizeof(context->format_buffer), offset, ZYAN_NULL);
}
}
offset += context->instruction.length;
++count;
}
return count;
}
static void TestPerformance(const ZyanU8* buffer, ZyanUSize length, ZyanBool minimal_mode,
ZyanBool format, ZyanBool tokenize, ZyanBool use_cache)
{
ZydisDecoder decoder;
if (!ZYAN_SUCCESS(ZydisDecoderInit(&decoder, ZYDIS_MACHINE_MODE_LONG_64,
ZYDIS_STACK_WIDTH_64)))
{
ZYAN_FPRINTF(ZYAN_STDERR, "%sFailed to initialize decoder%s\n",
CVT100_ERR(COLOR_ERROR), CVT100_ERR(ZYAN_VT100SGR_RESET));
exit(EXIT_FAILURE);
}
if (!ZYAN_SUCCESS(ZydisDecoderEnableMode(&decoder, ZYDIS_DECODER_MODE_MINIMAL, minimal_mode)))
{
ZYAN_FPRINTF(ZYAN_STDERR, "%sFailed to adjust decoder-mode%s\n",
CVT100_ERR(COLOR_ERROR), CVT100_ERR(ZYAN_VT100SGR_RESET));
exit(EXIT_FAILURE);
}
// ZydisCacheTable cache;
// if (use_cache && !ZYAN_SUCCESS(ZydisDecoderInitCache(&decoder, &cache)))
// {
// ZYAN_FPRINTF(ZYAN_STDERR, "%sFailed to initialize decoder-cache%s\n",
// CVT100_ERR(COLOR_ERROR), CVT100_ERR(ZYAN_VT100SGR_RESET));
// exit(EXIT_FAILURE);
// }
ZydisFormatter formatter;
if (format)
{
if (!ZYAN_SUCCESS(ZydisFormatterInit(&formatter, ZYDIS_FORMATTER_STYLE_INTEL)) ||
!ZYAN_SUCCESS(ZydisFormatterSetProperty(&formatter,
ZYDIS_FORMATTER_PROP_FORCE_SEGMENT, ZYAN_TRUE)) ||
!ZYAN_SUCCESS(ZydisFormatterSetProperty(&formatter,
ZYDIS_FORMATTER_PROP_FORCE_SIZE, ZYAN_TRUE)))
{
ZYAN_FPRINTF(ZYAN_STDERR, "%sFailed to initialize instruction-formatter%s\n",
CVT100_ERR(COLOR_ERROR), CVT100_ERR(ZYAN_VT100SGR_RESET));
exit(EXIT_FAILURE);
}
}
TestContext context;
context.minimal_mode = minimal_mode;
context.format = format;
context.tokenize = tokenize;
// Cache warmup
ProcessBuffer(&decoder, &formatter, &context, buffer, length);
// Testing
ZyanU64 count = 0;
StartCounter();
for (ZyanU8 j = 0; j < 100; ++j)
{
count += ProcessBuffer(&decoder, &formatter, &context, buffer, length);
}
const char* color[4];
color[0] = minimal_mode ? CVT100_OUT(COLOR_VALUE_G) : CVT100_OUT(COLOR_VALUE_B);
color[1] = format ? CVT100_OUT(COLOR_VALUE_G) : CVT100_OUT(COLOR_VALUE_B);
color[2] = tokenize ? CVT100_OUT(COLOR_VALUE_G) : CVT100_OUT(COLOR_VALUE_B);
color[3] = use_cache ? CVT100_OUT(COLOR_VALUE_G) : CVT100_OUT(COLOR_VALUE_B);
ZYAN_PRINTF("Minimal-Mode %s%d%s, Format %s%d%s, Tokenize %s%d%s, Caching %s%d%s, " \
"Instructions: %s%6.2fM%s, Time: %s%8.2f%s msec\n",
color[0], minimal_mode, CVT100_OUT(COLOR_DEFAULT),
color[1], format, CVT100_OUT(COLOR_DEFAULT),
color[2], tokenize, CVT100_OUT(COLOR_DEFAULT),
color[3], use_cache, CVT100_OUT(COLOR_DEFAULT),
CVT100_OUT(COLOR_VALUE_B), (double)count / 1000000, CVT100_OUT(COLOR_DEFAULT),
CVT100_OUT(COLOR_VALUE_G), GetCounter(), CVT100_OUT(COLOR_DEFAULT));
}
static void GenerateTestData(FILE* file, ZyanU8 encoding)
{
ZydisDecoder decoder;
if (!ZYAN_SUCCESS(
ZydisDecoderInit(&decoder, ZYDIS_MACHINE_MODE_LONG_64, ZYDIS_STACK_WIDTH_64)))
{
ZYAN_FPRINTF(ZYAN_STDERR, "%sFailed to initialize decoder%s\n", CVT100_ERR(COLOR_ERROR),
CVT100_ERR(ZYAN_VT100SGR_RESET));
exit(EXIT_FAILURE);
}
ZyanU8 last = 0;
ZyanU32 count = 0;
ZydisDecodedInstruction instruction;
while (count < 100000)
{
ZyanU8 data[ZYDIS_MAX_INSTRUCTION_LENGTH];
for (int i = 0; i < ZYDIS_MAX_INSTRUCTION_LENGTH; ++i)
{
data[i] = rand() % 256;
}
const ZyanU8 offset = rand() % (ZYDIS_MAX_INSTRUCTION_LENGTH - 2);
switch (encoding)
{
case 0:
break;
case 1:
data[offset ] = 0x0F;
data[offset + 1] = 0x0F;
break;
case 2:
data[offset ] = 0x8F;
break;
case 3:
data[offset ] = 0xC4;
break;
case 4:
data[offset ] = 0xC5;
break;
case 5:
case 6:
data[offset ] = 0x62;
break;
default:
ZYAN_UNREACHABLE;
}
if (ZYAN_SUCCESS(ZydisDecoderDecodeInstruction(&decoder, ZYAN_NULL, data,
sizeof(data), &instruction)))
{
ZyanBool b = ZYAN_FALSE;
switch (encoding)
{
case 0:
b = (instruction.encoding == ZYDIS_INSTRUCTION_ENCODING_LEGACY);
break;
case 1:
b = (instruction.encoding == ZYDIS_INSTRUCTION_ENCODING_3DNOW);
break;
case 2:
b = (instruction.encoding == ZYDIS_INSTRUCTION_ENCODING_XOP);
break;
case 3:
case 4:
b = (instruction.encoding == ZYDIS_INSTRUCTION_ENCODING_VEX);
break;
case 5:
b = (instruction.encoding == ZYDIS_INSTRUCTION_ENCODING_EVEX);
break;
case 6:
b = (instruction.encoding == ZYDIS_INSTRUCTION_ENCODING_MVEX);
break;
default:
ZYAN_UNREACHABLE;
}
if (b)
{
fwrite(&data[0], sizeof(ZyanU8), instruction.length, file);
++count;
const ZyanU8 p = (ZyanU8)((double)count / 100000 * 100);
if (last < p)
{
last = p;
ZYAN_PRINTF("%3.0d%%\n", p);
}
}
}
}
}
/* ============================================================================================== */
/* Entry point */
/* ============================================================================================== */
int main(int argc, char** argv)
{
// Enable VT100 escape sequences on Windows, if the output is not redirected
g_vt100_stdout = (ZyanTerminalIsTTY(ZYAN_STDSTREAM_OUT) == ZYAN_STATUS_TRUE) &&
ZYAN_SUCCESS(ZyanTerminalEnableVT100(ZYAN_STDSTREAM_OUT));
g_vt100_stderr = (ZyanTerminalIsTTY(ZYAN_STDSTREAM_ERR) == ZYAN_STATUS_TRUE) &&
ZYAN_SUCCESS(ZyanTerminalEnableVT100(ZYAN_STDSTREAM_ERR));
if (ZydisGetVersion() != ZYDIS_VERSION)
{
ZYAN_FPRINTF(ZYAN_STDERR, "%sInvalid zydis version%s\n",
CVT100_ERR(COLOR_ERROR), CVT100_ERR(ZYAN_VT100SGR_RESET));
return EXIT_FAILURE;
}
if (argc < 3 || (ZYAN_STRCMP(argv[1], "-test") && ZYAN_STRCMP(argv[1], "-generate")))
{
ZYAN_FPRINTF(ZYAN_STDERR, "%sUsage: %s -[test|generate] [directory]%s\n",
CVT100_ERR(COLOR_ERROR), (argc > 0 ? argv[0] : "PerfTest"),
CVT100_ERR(ZYAN_VT100SGR_RESET));
return EXIT_FAILURE;
}
ZyanBool generate = ZYAN_FALSE;
if (!ZYAN_STRCMP(argv[1], "-generate"))
{
generate = ZYAN_TRUE;
}
const char* directory = argv[2];
static const struct
{
const char* encoding;
const char* filename;
} tests[7] =
{
{ "DEFAULT", "enc_default.dat" },
{ "3DNOW" , "enc_3dnow.dat" },
{ "XOP" , "enc_xop.dat" },
{ "VEX_C4" , "enc_vex_c4.dat" },
{ "VEX_C5" , "enc_vex_c5.dat" },
{ "EVEX" , "enc_evex.dat" },
{ "MVEX" , "enc_mvex.dat" }
};
if (generate)
{
time_t t;
srand((unsigned)time(&t));
} else
{
AdjustProcessAndThreadPriority();
}
for (ZyanU8 i = 0; i < ZYAN_ARRAY_LENGTH(tests); ++i)
{
FILE* file;
const ZyanUSize len = strlen(directory);
char buf[1024];
strncpy(&buf[0], directory, sizeof(buf) - 1);
if (generate)
{
file = fopen(strncat(buf, tests[i].filename, sizeof(buf) - len - 1), "wb");
} else
{
file = fopen(strncat(buf, tests[i].filename, sizeof(buf) - len - 1), "rb");
}
if (!file)
{
ZYAN_FPRINTF(ZYAN_STDERR, "%sCould not open file \"%s\": %s%s\n",
CVT100_ERR(COLOR_ERROR), &buf[0], strerror(ZYAN_ERRNO),
CVT100_ERR(ZYAN_VT100SGR_RESET));
continue;
}
if (generate)
{
ZYAN_PRINTF("Generating %s%s%s ...\n", CVT100_OUT(COLOR_VALUE_B), tests[i].encoding,
CVT100_OUT(ZYAN_VT100SGR_RESET));
GenerateTestData(file, i);
} else
{
fseek(file, 0L, SEEK_END);
const long length = ftell(file);
void* buffer = malloc(length);
if (!buffer)
{
ZYAN_FPRINTF(ZYAN_STDERR,
"%sFailed to allocate %" PRIu64 " bytes on the heap%s\n",
CVT100_ERR(COLOR_ERROR), (ZyanU64)length, CVT100_ERR(ZYAN_VT100SGR_RESET));
goto NextFile2;
}
rewind(file);
if (fread(buffer, 1, length, file) != (ZyanUSize)length)
{
ZYAN_FPRINTF(ZYAN_STDERR,
"%sCould not read %" PRIu64 " bytes from file \"%s\"%s\n",
CVT100_ERR(COLOR_ERROR), (ZyanU64)length, &buf[0],
CVT100_ERR(ZYAN_VT100SGR_RESET));
goto NextFile1;
}
ZYAN_PRINTF("%sTesting %s%s%s ...\n", CVT100_OUT(ZYAN_VT100SGR_FG_MAGENTA),
CVT100_OUT(ZYAN_VT100SGR_FG_BRIGHT_MAGENTA), tests[i].encoding,
CVT100_OUT(COLOR_DEFAULT));
TestPerformance(buffer, length, ZYAN_TRUE , ZYAN_FALSE, ZYAN_FALSE, ZYAN_FALSE);
TestPerformance(buffer, length, ZYAN_FALSE, ZYAN_FALSE, ZYAN_FALSE, ZYAN_FALSE);
// TestPerformance(buffer, length, ZYAN_FALSE, ZYAN_FALSE, ZYAN_FALSE, ZYAN_TRUE);
TestPerformance(buffer, length, ZYAN_FALSE, ZYAN_TRUE , ZYAN_FALSE, ZYAN_FALSE);
// TestPerformance(buffer, length, ZYAN_FALSE, ZYAN_TRUE , ZYAN_FALSE, ZYAN_TRUE);
TestPerformance(buffer, length, ZYAN_FALSE, ZYAN_TRUE , ZYAN_TRUE , ZYAN_FALSE);
// TestPerformance(buffer, length, ZYAN_FALSE, ZYAN_TRUE , ZYAN_TRUE , ZYAN_TRUE);
ZYAN_PUTS("");
NextFile1:
free(buffer);
}
NextFile2:
fclose(file);
}
return 0;
}
/* ============================================================================================== */