Skip to content

Commit

Permalink
Performance test updated to handle CMP v19
Browse files Browse the repository at this point in the history
  • Loading branch information
clwi committed Sep 25, 2020
1 parent d60634b commit 395f824
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@ The shell script `runModuleTest.sh` runs the module test. The test checks that i

The performance test is run by the shell script `runPerformanceTest.sh`. The script assumes that the repositories for CWPack, MPack and CMP are side by side in the same folder.

The performance test is targeted to CMP v19 and MPack v1.0.

The performance test checks the duration of a number of calls by calling them 1.000.000 times.
4 changes: 2 additions & 2 deletions test/cwpack_performance_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ static double milliseconds(void) {

#define BEFORE_PTEST(code) \
cw_pack_context_init(&pc, buffer, BUF_Length, 0);\
cmp_init(&cc, buffer, 0, b_writer);\
cmp_init(&cc, buffer, 0, 0, b_writer);\
mpack_writer_init(&mw, buffer, BUF_Length); \
code; \
itemSize = (int)(pc.current - pc.start); \
Expand Down Expand Up @@ -171,7 +171,7 @@ static void pack_test(void)
unsigned int l = (unsigned int)(pc.current - pc.start); \
cw_unpack_context_init (&uc, buffer, l, 0); \
mpack_reader_init_data (&mr, buffer, l); \
cmp_init(&cc, buffer, b_reader, 0);\
cmp_init(&cc, buffer, b_reader, 0, 0);\
printf("Buffer filled with: %-35s\n", #code); \
}

Expand Down

0 comments on commit 395f824

Please sign in to comment.