ran more tests
This commit is contained in:
parent
6826105aca
commit
e8352d1810
10
.vscode/settings.json
vendored
Normal file
10
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"files.associations": {
|
||||||
|
"*.pyx": "python",
|
||||||
|
"*.js": "javascript",
|
||||||
|
"*.c": "c",
|
||||||
|
"*.scene": "yaml",
|
||||||
|
"*.cene": "yaml",
|
||||||
|
"iomanip": "cpp"
|
||||||
|
}
|
||||||
|
}
|
20
README.md
20
README.md
@ -1,7 +1,25 @@
|
|||||||
# Fast-Vector
|
# Fast-Vector
|
||||||
|
|
||||||
## 1.07 times faster
|
## 1.07 times faster
|
||||||
|
With O3 flag
|
||||||
|
|
||||||
|
|
||||||
A Backwards Compatible Vector Class, that's fast.
|
A Backwards Compatible Vector Class, that's fast.
|
||||||
|
|
||||||

|
## Test:
|
||||||
|
|
||||||
|
### 100,000,000 push_backs
|
||||||
|

|
||||||
|
|
||||||
|
### 100,000 push_backs
|
||||||
|
|
||||||
|
images/
|
||||||
|
|
||||||
|
|
||||||
|
### 100 push_backs
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
|
||||||
|
Note:
|
||||||
|
Speeds May Very based on use.
|
BIN
images/image-1.png
Normal file
BIN
images/image-1.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 19 KiB |
BIN
images/image-2.png
Normal file
BIN
images/image-2.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
@ -11,9 +11,9 @@
|
|||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace std::chrono;
|
using namespace std::chrono;
|
||||||
|
|
||||||
static constexpr size_t N = 100'000'000;
|
static constexpr size_t N = 100'000;
|
||||||
static constexpr int SHORT_RUNS = 3;
|
static constexpr int SHORT_RUNS = 3;
|
||||||
static constexpr int LONG_RUNS = 10;
|
static constexpr int LONG_RUNS = 1000;
|
||||||
|
|
||||||
constexpr const char* COLOR_RESET = "\033[0m";
|
constexpr const char* COLOR_RESET = "\033[0m";
|
||||||
constexpr const char* COLOR_RED = "\033[31m";
|
constexpr const char* COLOR_RED = "\033[31m";
|
||||||
@ -68,9 +68,9 @@ void print_test(const std::string& name, Stats std_stats, Stats fast_stats) {
|
|||||||
cout << color << status << COLOR_RESET
|
cout << color << status << COLOR_RESET
|
||||||
<< " " << left << setw(27) << name
|
<< " " << left << setw(27) << name
|
||||||
<< " | std: " << right << setw(7) << fixed << setprecision(2) << std_stats.mean << "ms"
|
<< " | std: " << right << setw(7) << fixed << setprecision(2) << std_stats.mean << "ms"
|
||||||
<< " ±" << setw(5) << std_stats.stddev
|
<< " +-" << setw(7) << std_stats.stddev
|
||||||
<< " | fast: " << setw(7) << fast_stats.mean << "ms"
|
<< " | fast: " << setw(7) << fast_stats.mean << "ms"
|
||||||
<< " ±" << setw(5) << fast_stats.stddev
|
<< " +-" << setw(7) << fast_stats.stddev
|
||||||
<< " | x" << color << setw(6) << setprecision(2) << speedup << COLOR_RESET
|
<< " | x" << color << setw(6) << setprecision(2) << speedup << COLOR_RESET
|
||||||
<< '\n';
|
<< '\n';
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user