diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..9699001 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,10 @@ +{ + "files.associations": { + "*.pyx": "python", + "*.js": "javascript", + "*.c": "c", + "*.scene": "yaml", + "*.cene": "yaml", + "iomanip": "cpp" + } +} \ No newline at end of file diff --git a/README.md b/README.md index cbe22bb..9b162ff 100644 --- a/README.md +++ b/README.md @@ -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) \ No newline at end of file +## 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. \ No newline at end of file diff --git a/images/image-1.png b/images/image-1.png new file mode 100644 index 0000000..57c9a17 Binary files /dev/null and b/images/image-1.png differ diff --git a/images/image-2.png b/images/image-2.png new file mode 100644 index 0000000..c154d54 Binary files /dev/null and b/images/image-2.png differ diff --git a/image.png b/images/image.png similarity index 100% rename from image.png rename to images/image.png diff --git a/src/test.cpp b/src/test.cpp index d37556c..a0ca95a 100644 --- a/src/test.cpp +++ b/src/test.cpp @@ -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'; }