Skip to content

Commit 09a350d

Browse files
authored
Merge pull request #30 from wx257osn2/add-cpp20
Add unregulated-cpp20
2 parents db6a346 + ecc5561 commit 09a350d

File tree

17 files changed

+239
-5
lines changed

17 files changed

+239
-5
lines changed

.gitmodules

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,30 @@
11
[submodule "cpp/external_projects/unordered_dense"]
22
path = cpp/external_projects/unordered_dense
33
url = https://github.com/martinus/unordered_dense
4+
[submodule "unregulated-cpp20/external_projects/unordered_dense"]
5+
path = unregulated-cpp20/external_projects/unordered_dense
6+
url = https://github.com/martinus/unordered_dense
7+
[submodule "unregulated-cpp20/external_projects/fast_io"]
8+
path = unregulated-cpp20/external_projects/fast_io
9+
url = https://github.com/cppfastio/fast_io
10+
[submodule "unregulated-cpp20/external_projects/container"]
11+
path = unregulated-cpp20/external_projects/container
12+
url = https://github.com/boostorg/container
13+
[submodule "unregulated-cpp20/external_projects/move"]
14+
path = unregulated-cpp20/external_projects/move
15+
url = https://github.com/boostorg/move
16+
[submodule "unregulated-cpp20/external_projects/intrusive"]
17+
path = unregulated-cpp20/external_projects/intrusive
18+
url = https://github.com/boostorg/intrusive
19+
[submodule "unregulated-cpp20/external_projects/config"]
20+
path = unregulated-cpp20/external_projects/config
21+
url = https://github.com/boostorg/config
22+
[submodule "unregulated-cpp20/external_projects/assert"]
23+
path = unregulated-cpp20/external_projects/assert
24+
url = https://github.com/boostorg/assert
25+
[submodule "unregulated-cpp20/external_projects/static_assert"]
26+
path = unregulated-cpp20/external_projects/static_assert
27+
url = https://github.com/boostorg/static_assert
28+
[submodule "unregulated-cpp20/external_projects/core"]
29+
path = unregulated-cpp20/external_projects/core
30+
url = https://github.com/boostorg/core

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Simple benchmarks of Dijkstra algorithm among C++, Go, Julia, Python(+Cython +Py
1010
This benchmark uses [hyperfine](https://github.com/sharkdp/hyperfine). Follow the install instruction there.
1111

1212

13-
Submodules are contained. You need to
13+
For `cpp` and `unregulated-cpp20` , submodules are contained. You need to
1414

1515
```
1616
git submodule update --init --recursive
@@ -33,6 +33,7 @@ You need running environments for languages below:
3333
- Kotlin : 1.7 + jdk >= 18
3434
- Julia : 1.7
3535
- Clang : 7 (or versions which support C++17)
36+
- GCC(g++) : 10 (or versions which support C++20)
3637
- Dart : 2.16.1
3738
- Python : 3.10, Cython 0.29, PyPy 3.9-7.3.9
3839

@@ -77,7 +78,7 @@ for all languages
7778

7879
for specific language
7980
```
80-
./run.sh [cpp|go|rust|javascript|julia|kotlin|python|cython|pypy|dart]
81+
./run.sh [cpp|go|rust|javascript|julia|kotlin|python|cython|pypy|dart|unregulated-cpp20]
8182
```
8283

8384
for test setup - choose one implementation (ex.`cpp`) to make a 'correct' result.
@@ -89,5 +90,5 @@ mv out/cpp.txt out/expected.txt
8990

9091
for test
9192
```
92-
./test.sh [cpp|go|rust|javascript|julia|kotlin|python|cython|pypy|dart]
93+
./test.sh [cpp|go|rust|javascript|julia|kotlin|python|cython|pypy|dart|unregulated-cpp20]
9394
```

run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function build {
2525
if [ -n "$*" ]; then
2626
langs="$*"
2727
else
28-
langs="cpp go rust javascript julia kotlin python cython pypy dart"
28+
langs="cpp go rust javascript julia kotlin python cython pypy dart unregulated-cpp20"
2929
fi
3030

3131
for lang in $(echo $langs); do

test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ if [ -n "$1" ]; then
1818
check $lang
1919
done
2020
else
21-
for lang in cpp go rust javascript julia kotlin python cython pypy dart; do
21+
for lang in cpp go rust javascript julia kotlin python cython pypy dart unregulated-cpp20; do
2222
check $lang
2323
done
2424
fi

unregulated-cpp20/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
main

unregulated-cpp20/Makefile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
all: main
2+
3+
clean:
4+
rm -f main
5+
6+
INCLUDE_BOOST_CONTAINER = \
7+
-I external_projects/container/include \
8+
-I external_projects/move/include \
9+
-I external_projects/intrusive/include \
10+
-I external_projects/config/include \
11+
-I external_projects/assert/include \
12+
-I external_projects/static_assert/include \
13+
-I external_projects/core/include \
14+
-Wno-stringop-overread
15+
16+
main: src/main.cpp
17+
g++ -std=c++20 -O3 -Wall -Wextra -pedantic-errors -march=native -mtune=native -I external_projects/unordered_dense/include -I external_projects/fast_io/include -DFAST_IO_OPTIMIZE_SIZE $(INCLUDE_BOOST_CONTAINER) -o $@ $<
18+
19+
.PHONY: all clean

unregulated-cpp20/bench.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
./main "$@"
Submodule assert added at 7dea14c
Submodule config added at c35885c
Submodule container added at 231dd48

0 commit comments

Comments
 (0)