Skip to content
This repository was archived by the owner on Sep 27, 2019. It is now read-only.

Commit 700f986

Browse files
committed
Revert IPS4O sort to std::sort for now. We'll switch to IPS4O in another PR.
1 parent b491363 commit 700f986

26 files changed

+16
-3324
lines changed

src/codegen/compact_storage.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
#include "codegen/compact_storage.h"
1414

15-
#include "ips4o/ips4o.hpp"
15+
#include <algorithm>
1616

1717
#include "codegen/type/sql_type.h"
1818

@@ -140,10 +140,10 @@ llvm::Type *CompactStorage::Setup(CodeGen &codegen,
140140

141141
// Sort the entries by decreasing size. This minimizes storage overhead due to
142142
// padding (potentially) added by LLVM.
143-
ips4o::sort(storage_format_.begin(), storage_format_.end(),
144-
[](const EntryInfo &left, const EntryInfo &right) {
145-
return right.num_bytes < left.num_bytes;
146-
});
143+
std::sort(storage_format_.begin(), storage_format_.end(),
144+
[](const EntryInfo &left, const EntryInfo &right) {
145+
return right.num_bytes < left.num_bytes;
146+
});
147147

148148
// Now we construct the LLVM type of this storage space. First comes bytes
149149
// to manage the null bitmap. Then all the data elements.

src/codegen/updateable_storage.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
#include "codegen/updateable_storage.h"
1414

15-
#include "ips4o/ips4o.hpp"
15+
#include <algorithm>
1616

1717
#include "codegen/lang/if.h"
1818
#include "codegen/type/sql_type.h"
@@ -66,11 +66,11 @@ llvm::Type *UpdateableStorage::Finalize(CodeGen &codegen) {
6666
}
6767

6868
// Sort the entries by decreasing size
69-
ips4o::sort(storage_format_.begin(), storage_format_.end(),
70-
[](const CompactStorage::EntryInfo &left,
71-
const CompactStorage::EntryInfo &right) {
72-
return right.num_bytes < left.num_bytes;
73-
});
69+
std::sort(storage_format_.begin(), storage_format_.end(),
70+
[](const CompactStorage::EntryInfo &left,
71+
const CompactStorage::EntryInfo &right) {
72+
return right.num_bytes < left.num_bytes;
73+
});
7474

7575
// Now we construct the LLVM type of this storage space
7676
std::vector<llvm::Type *> llvm_types;

src/codegen/util/sorter.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,9 @@
1212

1313
#include "codegen/util/sorter.h"
1414

15+
#include <algorithm>
1516
#include <queue>
1617

17-
#include "ips4o/ips4o.hpp"
18-
1918
#include "common/synchronization/count_down_latch.h"
2019
#include "common/timer.h"
2120
#include "threadpool/mono_queue_pool.h"
@@ -87,8 +86,10 @@ void Sorter::Sort() {
8786
timer.Start();
8887

8988
// Sort the sucker
89+
// TODO(pmenon): The standard std::sort is super slow. We should consider a
90+
// switch to IPS4O which is up to 3-4x faster.
9091
auto cmp = [this](char *l, char *r) { return cmp_func_(l, r) < 0; };
91-
ips4o::sort(tuples_.begin(), tuples_.end(), cmp);
92+
std::sort(tuples_.begin(), tuples_.end(), cmp);
9293

9394
// Setup pointers
9495
tuples_start_ = tuples_.data();
@@ -170,7 +171,7 @@ void Sorter::SortParallel(
170171
// Sort the local separators and choose the median
171172
char *separator = nullptr;
172173
if (idx < separators.size() - 1) {
173-
ips4o::sort(separators[idx].begin(), separators[idx].end(), cmp);
174+
std::sort(separators[idx].begin(), separators[idx].end(), cmp);
174175
separator = separators[idx][sorters.size() / 2];
175176
}
176177

third_party/ips4o/LICENSE

Lines changed: 0 additions & 27 deletions
This file was deleted.

third_party/ips4o/README.md

Lines changed: 0 additions & 35 deletions
This file was deleted.

third_party/ips4o/ips4o.hpp

Lines changed: 0 additions & 38 deletions
This file was deleted.

third_party/ips4o/ips4o/base_case.hpp

Lines changed: 0 additions & 82 deletions
This file was deleted.

0 commit comments

Comments
 (0)