Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Artemis: Proposed changes for increased performance #26

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions Reverse.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
#include "Reverse.h"

std::string Reverse::reverse(std::string& toReverse)
{
std::string Reverse::reverse(std::string& toReverse) {
std::string ret;

for(std::string::reverse_iterator rit=toReverse.rbegin(); rit!=toReverse.rend(); ++rit)
{
for(std::string::reverse_iterator rit = toReverse.rbegin(); rit != toReverse.rend(); ++rit) {
ret.insert(ret.end(), *rit);
}
return ret;
}
}
10 changes: 6 additions & 4 deletions high_load.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#include <unordered_map>
#include <folly/FBVector.h>
#include "high_load.h"

#include <bits/stdc++.h>
Expand All @@ -14,18 +16,18 @@ bool BenchmarkRunner::benchmark(){
srand( (unsigned)time(NULL) );
for(int i=0;i<5000;i++) {
boost::container::flat_map<int, int> test_map;
boost::container::stable_vector<int> test_keys;
folly::fbvector<int> test_keys;
// Insert random keys
for (int i = 0; i < 1000; i++) {
int random_key = rand() % 100000;
test_map[random_key] = 0;
test_keys.push_back(random_key);
test_keys.emplace_back(random_key);
}

for (int key : test_keys) {
test_map[key] += 1;
}
map<int, int> m;
std::unordered_map<int, int> m;
}
return true;
}
}
5 changes: 3 additions & 2 deletions main.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include <folly/FBVector.h>
#include <iostream>
#include <boost/shared_ptr.hpp>
#include <boost/filesystem.hpp>
Expand All @@ -6,7 +7,7 @@
int main(int argc, char *argv[])
{
std::cout << "Hello Third Party Include!" << std::endl;
std::vector<int> v;
folly::fbvector<int> v;

// use a shared ptr
boost::shared_ptr<int> isp(new int(4));
Expand All @@ -23,4 +24,4 @@ int main(int argc, char *argv[])
}

return 0;
}
}
Empty file modified post_test.sh
100755 → 100644
Empty file.