a playground to implement impossible stuff in C++. The repository binds in google benchmark and gtest for better testing and benchmarking
yes! there is already boost's signal and slots, and you can also use the observer pattern used extensively in JUCE, but this one tries to mimick the behaviour of events in C#. That is the event is public for subscription and raising the event can be held private for the object that owns the event
three different implementations of dynamic arrays are presented:
- AlignedArray with underlying std::vector
- AlignedCArray with underlying raw pointers and malloc
- Simple imlementaiton with new and delete
values are in micro seconds and the numbers in first coloumn are the sizes of array in both dimensions
Run on (4 X 2900 MHz CPU s)
CPU Caches:
- L1 Data 32K (x2)
- L1 Instruction 32K (x2)
- L2 Unified 262K (x2)
- L3 Unified 3145K (x1)
Benchmark | Time | CPU |
---|---|---|
aligned_c++_vector_benchmark/8 | 0.021 | 0.020 |
aligned_c++_vector_benchmark/256 | 10.4 | 10.3 |
aligned_c++_vector_benchmark/8192 | 28792 | 28743 |
aligned_c_array_benchmark/8 | 0.019 | 0.019 |
aligned_c_array_benchmark/256 | 10.1 | 10.1 |
aligned_c_array_benchmark/8192 | 31104 | 31005 |
array_benchmark/8 | 0.019 | 0.019 |
array_benchmark/256 | 12.0 | 11.8 |
array_benchmark/8192 | 35231 | 35189 |