Skip to content

Commit 2dfa1d2

Browse files
committed
modify configuration
Signed-off-by: “lrlrl” <[email protected]>
1 parent 529a574 commit 2dfa1d2

File tree

7 files changed

+32
-18
lines changed

7 files changed

+32
-18
lines changed

examples/kyotocabinet/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,14 @@ cd examples/kyotocabinet/
3333
./campaign_kyotocabinet.py
3434
```
3535

36+
There is also a campaign that uses the platform **stabilization**
37+
features of `benchkit` (the `helpers/linux/predictable` folder).
38+
To run it, run the following:
39+
40+
```bash
41+
./campaign_kyotocabinet_stable.py
42+
```
43+
3644
Another possible use case is `perf` that can be used as a command wrapper to
3745
collect performance monitoring information into the CSV file or the data
3846
directory:

examples/kyotocabinet/campaign_kyotocabinet_flame.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ def main() -> None:
3434
# coupling the benchmark with the perf wrapper.
3535
campaign = kyotocabinet_campaign(
3636
src_dir=kyotocabinet_src_dir,
37-
test_name=[],
37+
test_name=[
38+
"benchmark",
39+
],
3840
nb_runs=1,
3941
benchmark_duration_seconds=3,
4042
nb_threads=[1, 8, 16],

examples/kyotocabinet/campaign_kyotocabinet_perf.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ def main() -> None:
2929
# Define the campaign, associated with the Kyoto Cabinet benchmark
3030
campaign = kyotocabinet_campaign(
3131
src_dir=kyotocabinet_src_dir,
32-
test_name=[],
32+
test_name=[
33+
"benchmark",
34+
],
3335
nb_runs=1,
3436
benchmark_duration_seconds=3,
3537
nb_threads=[2, 4],

examples/kyotocabinet/campaign_kyotocabinet_stable.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ def main() -> None:
2323
# Define the campaign, associated with the LevelDB benchmark
2424
campaign = kyotocabinet_campaign(
2525
src_dir=kyotocabinet_src_dir,
26-
test_name=[],
26+
test_name=[
27+
"benchmark",
28+
],
2729
nb_runs=3,
2830
benchmark_duration_seconds=2,
2931
nb_threads=[8],
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
../..
22
./kit
3-
../examples/tilt/kit
3+
../tilt/kit

examples/kyotocabinet/patches/02-cloudflare.diff

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ index 0000000..b196781
6969
+/* if on motoral, sun, ibm; uncomment this */
7070
+/* #define WORDS_BIGENDIAN 1 */
7171
+/* else for Intel, Amd; uncomment this */
72-
+#undef WORDS_BIGENDIAN
72+
+#undef WORDS_BIGENDIAN
7373
+
7474
+#include "modp_b64_data.h"
7575
+

examples/kyotocabinet/patches/03-benchmark.diff

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,17 @@ index 0000000..299669a
3636
+/////////////////////////////////////////////////////////
3737
+// HELPER FUNCTIONS
3838
+/////////////////////////////////////////////////////////
39-
+static inline int MarsagliaXORV (int x) {
40-
+ if (x == 0) x = 1 ;
39+
+static inline int MarsagliaXORV (int x) {
40+
+ if (x == 0) x = 1 ;
4141
+ x ^= x << 6;
4242
+ x ^= ((unsigned)x) >> 21;
43-
+ x ^= x << 7 ;
43+
+ x ^= x << 7 ;
4444
+ return x ; // use either x or x & 0x7FFFFFFF
4545
+}
4646
+
4747
+static inline int MarsagliaXOR (int * seed) {
4848
+ int x = MarsagliaXORV(*seed);
49-
+ *seed = x ;
49+
+ *seed = x ;
5050
+ return x & 0x7FFFFFFF;
5151
+}
5252
+
@@ -60,10 +60,10 @@ index 0000000..299669a
6060
+static inline int rand_range(int n, unsigned short *seed)
6161
+{
6262
+ /* Return a random number in range [0;n) */
63-
+
63+
+
6464
+ /*int v = (int)(erand48(seed) * n);
6565
+ assert (v >= 0 && v < n);*/
66-
+
66+
+
6767
+ int v = MarsagliaXOR((int *)seed) % n;
6868
+ return v;
6969
+}
@@ -163,7 +163,7 @@ index 0000000..299669a
163163
+ int range = rnum_ * 2;
164164
+ for (int i = 1; !err_ && i <= rnum_; i++) {
165165
+ char kbuf[64];
166-
+ size_t ksiz = sprintf(kbuf, "%08lld",
166+
+ size_t ksiz = sprintf(kbuf, "%08lld",
167167
+ (long long)rand_range(range + 1, seed));
168168
+ if (!db_->set(kbuf, ksiz, kbuf, ksiz)) {
169169
+ assert(0 && "Error in setting\n");
@@ -206,7 +206,7 @@ index 0000000..299669a
206206
+ while (!stop) {
207207
+ int op = rand_range(1000, seed);
208208
+ char kbuf[64];
209-
+ size_t ksiz = sprintf(kbuf, "%08lld",
209+
+ size_t ksiz = sprintf(kbuf, "%08lld",
210210
+ (long long)rand_range(range+1, seed));
211211
+ if (op < update_) {
212212
+ if (1 || (op & 0x01) == 0) {
@@ -264,7 +264,7 @@ index 0000000..299669a
264264
+ struct timespec timeout;
265265
+ timeout.tv_sec = duration / 1000;
266266
+ timeout.tv_nsec = (duration % 1000) * 1000000;
267-
+
267+
+
268268
+ printf("Setting Records\n");
269269
+
270270
+ ThreadSet threadsets[THREADMAX];
@@ -279,7 +279,7 @@ index 0000000..299669a
279279
+ threadsets[0].setparam(0, &db, rnum, thnum);
280280
+ threadsets[0].start();
281281
+ threadsets[0].join();
282-
+
282+
+
283283
+ printf("Done setting records\n");
284284
+
285285
+ stop = 0;
@@ -293,9 +293,9 @@ index 0000000..299669a
293293
+ long total_update = 0;
294294
+ long total_get = 0;
295295
+ long total_op = 0;
296-
+
296+
+
297297
+ if(duration > 0)
298-
+ nanosleep(&timeout, NULL);
298+
+ nanosleep(&timeout, NULL);
299299
+
300300
+ stop = 1;
301301
+
@@ -315,6 +315,6 @@ index 0000000..299669a
315315
+ dbmetaprint(&db, true);
316316
+ printf("Closing the database\n");
317317
+ if (!db.close())
318-
+ printf("Error in closing\n");
318+
+ printf("Error in closing\n");
319319
+
320320
+}

0 commit comments

Comments
 (0)