Commit graph

5 commits

Author SHA1 Message Date
Lőrinc
aa003d1568 build: Minimize I/O operations in GenerateHeaderFromRaw.cmake
Replaced multiple file writes with a single string template write.
The raw content is first grouped into 8 byte chunks, followed by another regex replace which wraps them in `std::byte`.

Tested the output with `diff -w` and they're the same - only whitespace differences because slightly different source formatting.

Tested the performance with:
> time cmake -DRAW_SOURCE_PATH=src/bench/data/block413567.raw -DHEADER_PATH=build/after/block413567.raw.h -DRAW_NAMESPACE=benchmark::data -P cmake/script/GenerateHeaderFromRaw.cmake

Before:
> 15.41s user 23.06s system 97% cpu 39.593 total
After:
> 0.77s user 0.06s system 97% cpu 0.849 total
2024-09-12 22:08:15 +02:00
Hennadii Stepanov
fdeb717e78
Revert "build: Minimize I/O operations in GenerateHeaderFrom{Json,Raw}.cmake"
This reverts commit b07fe666f2.
2024-09-12 16:34:57 +01:00
Hennadii Stepanov
b07fe666f2
build: Minimize I/O operations in GenerateHeaderFrom{Json,Raw}.cmake 2024-09-07 15:37:53 +01:00
MarcoFalke
faecca9a85
test: Use span for raw data
This change allows to drop brittle sizeof calls in favor of the
std::span::size method.

Other improvements include:

* Use of a namespace to mark test and bench data
* Use of the modern std::byte
* Drop of a no longer used std::vector copy and the bench/data module
2024-09-05 10:57:19 +02:00
Hennadii Stepanov
959370bd76
cmake: Build test_bitcoin executable 2024-08-16 19:27:39 +01:00