|
1 | 1 | # vapid soa
|
2 |
| -A simple header only library that implements structure of arrays data structure backed by std::vector. |
| 2 | +A simple c++17 header only library that implements structure of arrays data structure backed by std::vector. |
3 | 3 | These are the most useful operations.
|
4 | 4 | - `.insert(field1, field2, ...)` field_n inserts into the nth array
|
5 | 5 | - `.sort_by_field<col_idx>()` sort all columns in tandem based on particular column
|
6 |
| -- `.operator()[row_idx]` read data out as tuple of references |
| 6 | +- `.operator[](row_idx)` read data out as tuple of references |
7 | 7 | - `.get_column<col_idx>()` direct access to underlying std::vector column
|
8 |
| -- `.view<col_idx1, col_idx2, ...>()` read subset of the columns out as a tuple of references |
| 8 | +- `.view<col_idx1, col_idx2, ...>(row_idx)` read subset of the fields out as a tuple of references |
9 | 9 |
|
10 | 10 | Code Example (scratch.cpp)
|
11 | 11 | ------------------------
|
@@ -168,7 +168,7 @@ soa {
|
168 | 168 |
|
169 | 169 | Benchmark
|
170 | 170 | -------
|
171 |
| -We can observe speed ups for structure of arrays vs array of structs with the toy program benchmark.cc |
| 171 | +We can observe speed ups for structure of arrays (soa=vapid::soa) vs array of structs (vec=std::vector) with the toy program benchmark.cc. |
172 | 172 | Here are the results using Visual Studio 2022 on Release mode on my laptop.
|
173 | 173 |
|
174 | 174 | ```
|
@@ -216,8 +216,8 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
|
216 | 216 |
|
217 | 217 | http_archive(
|
218 | 218 | name = "com_github_markisus_vapid-soa",
|
219 |
| - url = "https://github.com/markisus/vapid-soa/archive/dc6b6d6a399b67cc1441965d9ba34642654f8ef4.zip", |
220 |
| - strip_prefix = "vapid-soa-dc6b6d6a399b67cc1441965d9ba34642654f8ef4") |
| 219 | + url = "https://github.com/markisus/vapid-soa/archive/d3c303a3fe15ebc4c8a7e3049bd21a3f663a42d0.zip", |
| 220 | + strip_prefix = "vapid-soa-d3c303a3fe15ebc4c8a7e3049bd21a3f663a42d0") |
221 | 221 | ```
|
222 | 222 | ```starlark
|
223 | 223 | # BUILD
|
|
0 commit comments