Skip to content

Commit d454568

Browse files
committed
merge
2 parents e2e0bd4 + b7f0dc6 commit d454568

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,15 @@ jobs:
3232
- name: Ensure docs is OK
3333
run: v check-md ~/.vmodules/msgpack/README.md
3434

35-
- name: Run example with -Wimpure-v
35+
- name: Ensure all examples compile with -W
36+
run: v -W should-compile-all ~/.vmodules/msgpack/examples/
37+
38+
- name: Run basic example with -Wimpure-v
3639
run: v -Wimpure-v crun ~/.vmodules/msgpack/examples/basic.v
3740

41+
- name: Run bench example
42+
run: v run ~/.vmodules/msgpack/examples/bench_msgpack_json_vs_json2.v
43+
3844
- name: Run example with -prod -cstrict -Wimpure-v -cc clang
3945
run: |
4046
cd ~/.vmodules/msgpack

examples/bench_msgpack_json_vs_json2.v

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,13 @@ fn main() {
5858
}
5959
}
6060
b.measure('msgpack.encode')
61+
62+
encoded := msgpack.encode[Person](p)
63+
dump(encoded#[0..10])
64+
mut decoder := msgpack.new_decoder()
65+
for _ in 0 .. max_iterations {
66+
// TODO: investigate why decoder.decode does not return a result at all :-|
67+
decoder.decode(encoded)!
68+
}
69+
b.measure('msgpack.decode')
6170
}

0 commit comments

Comments
 (0)