ran more tests

This commit is contained in:
OusmBlueNinja 2025-04-16 22:41:08 -05:00
parent 6826105aca
commit e8352d1810
6 changed files with 33 additions and 5 deletions

10
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,10 @@
{
"files.associations": {
"*.pyx": "python",
"*.js": "javascript",
"*.c": "c",
"*.scene": "yaml",
"*.cene": "yaml",
"iomanip": "cpp"
}
}

View File

@ -1,7 +1,25 @@
# Fast-Vector
## 1.07 times faster
With O3 flag
A Backwards Compatible Vector Class, that's fast.
![alt text](image.png)
## Test:
### 100,000,000 push_backs
![alt text](images/image.png)
### 100,000 push_backs
![alt text](images/image-1.png)images/
### 100 push_backs
![alt text](images/image-2.png)
Note:
Speeds May Very based on use.

BIN
images/image-1.png Normal file

Binary file not shown.

After

(image error) Size: 19 KiB

BIN
images/image-2.png Normal file

Binary file not shown.

After

(image error) Size: 18 KiB

View File

Before

(image error) Size: 22 KiB

After

(image error) Size: 22 KiB

View File

@ -11,9 +11,9 @@
using namespace std;
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 LONG_RUNS = 10;
static constexpr int LONG_RUNS = 1000;
constexpr const char* COLOR_RESET = "\033[0m";
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
<< " " << left << setw(27) << name
<< " | 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"
<< " ±" << setw(5) << fast_stats.stddev
<< " +-" << setw(7) << fast_stats.stddev
<< " | x" << color << setw(6) << setprecision(2) << speedup << COLOR_RESET
<< '\n';
}