Use sparse scan under a threshold
All checks were successful
Tests / Release [gcc] total: 375, passed: 375
GNU C Compiler (gcc) |Total|New|Outstanding|Fixed|Trend
|:-:|:-:|:-:|:-:|:-:
|0|0|0|0|:clap:
Reference build: <a href="https://jenkins.weaselab.dev/job/weaselab/job/conflict-set/job/main/16//gcc">weaselab » conflict-set » main #16</a>
Tests / Coverage total: 373, passed: 373
weaselab/conflict-set/pipeline/head This commit looks good
All checks were successful
Tests / Release [gcc] total: 375, passed: 375
GNU C Compiler (gcc) |Total|New|Outstanding|Fixed|Trend
|:-:|:-:|:-:|:-:|:-:
|0|0|0|0|:clap:
Reference build: <a href="https://jenkins.weaselab.dev/job/weaselab/job/conflict-set/job/main/16//gcc">weaselab » conflict-set » main #16</a>
Tests / Coverage total: 373, passed: 373
weaselab/conflict-set/pipeline/head This commit looks good
This commit is contained in:
@@ -741,6 +741,7 @@ int64_t maxBetweenExclusive(Node *n, int begin, int end) {
|
||||
assert(end <= 256);
|
||||
assert(begin < end);
|
||||
int64_t result = std::numeric_limits<int64_t>::lowest();
|
||||
constexpr int kSparseThreshold = 32;
|
||||
{
|
||||
int c = getChildGeq(n, begin + 1);
|
||||
if (c >= 0 && c < end) {
|
||||
@@ -771,20 +772,36 @@ int64_t maxBetweenExclusive(Node *n, int begin, int end) {
|
||||
}
|
||||
case Type::Node48: {
|
||||
auto *self = static_cast<Node48 *>(n);
|
||||
if (self->numChildren < kSparseThreshold) {
|
||||
for (int i = self->bitSet.firstSetGeq(begin + 1); i < end && i >= 0;
|
||||
i = self->bitSet.firstSetGeq(i + 1)) {
|
||||
if (self->index[i] != -1) {
|
||||
result = std::max(result, self->children[self->index[i]]->maxVersion);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (int i = begin + 1; i < end; ++i) {
|
||||
if (self->index[i] != -1) {
|
||||
result = std::max(result, self->children[self->index[i]]->maxVersion);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case Type::Node256: {
|
||||
auto *self = static_cast<Node256 *>(n);
|
||||
if (self->numChildren < kSparseThreshold) {
|
||||
for (int i = self->bitSet.firstSetGeq(begin + 1); i < end && i >= 0;
|
||||
i = self->bitSet.firstSetGeq(i + 1)) {
|
||||
result = std::max(result, self->children[i]->maxVersion);
|
||||
}
|
||||
} else {
|
||||
for (int i = begin + 1; i < end; ++i) {
|
||||
if (self->children[i] != nullptr) {
|
||||
result = std::max(result, self->children[i]->maxVersion);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case Type::Invalid:
|
||||
|
Reference in New Issue
Block a user