8000 Merge branch 'devel' of https://github.com/arangodb/arangodb into fea… · arangodb/arangodb@f9fab9b · GitHub
[go: up one dir, main page]

Skip to content

Commit f9fab9b

Browse files
committed
Merge branch 'devel' of https://github.com/arangodb/arangodb into feature/validation-aql-functions
* 'devel' of https://github.com/arangodb/arangodb: cheapify IN lookups on unsorted arrays (#11342) Bug fix/fix msvc2019 build (#11052)
2 parents 28c9f52 + 549295d commit f9fab9b

File tree

5 files changed

+46
-23
lines changed

5 files changed

+46
-23
lines changed

3rdParty/V8/v7.9.317/src/codegen/source-position.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -146,23 +146,23 @@ class SourcePosition final {
146146

147147
// The two below are only used if IsExternal() is true.
148148
using ExternalLineField = BitField64<int, 1, 20>;
149-
#ifdef DEBUG
149+
//#ifdef DEBUG
150150
// looks like debug build uses more external files
151151
// so extend bits for this field, but play safe for release builds
152152
using ExternalFileIdField = BitField64<int, 21, 16>;
153-
#else
154-
using ExternalFileIdField = BitField64<int, 21, 10>;
155-
#endif
153+
//#else
154+
// using ExternalFileIdField = BitField64<int, 21, 10>;
155+
//#endif
156156
// ScriptOffsetField is only used if IsExternal() is false.
157157
using ScriptOffsetField = BitField64<int, 1, 30>;
158158

159159
// InliningId is in the high bits for better compression in
160160
// SourcePositionTable.
161-
#ifdef DEBUG // also shift this field for above change for ExternalFileIdField
161+
//#ifdef DEBUG // also shift this field for above change for ExternalFileIdField
162162
using InliningIdField = BitField64<int, 37, 16>;
163-
#else
164-
using InliningIdField = BitField64<int, 31, 16>;
165-
#endif
163+
//#else
164+
// using InliningIdField = BitField64<int, 31, 16>;
165+
//#endif
166166
// Leaving the highest bit untouched to allow for signed conversion.
167167
uint64_t value_;
168168
};

VERSIONS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ CXX_STANDARD "17"
22
STARTER_REV "0.14.14"
33
SYNCER_REV "0.7.3"
44
GCC_LINUX "9.2.0"
5-
MSVC_WINDOWS "2017"
5+
MSVC_WINDOWS "2019"
66
MACOS_MIN "10.14"
77
OPENSSL_LINUX "1.1.1d"
88
OPENSSL_MACOS "1.1.1d"

arangod/Aql/AqlItemMatrix.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ ShadowAqlItemRow AqlItemMatrix::popShadowRow() {
151151
TRI_ASSERT(blockPtr->size() >= _startIndexInFirstBlock);
152152
_size = blockPtr->size() - _startIndexInFirstBlock;
153153
}
154-
// Remove all but the last
154+
// Remove all but the last block
155155
_blocks.erase(_blocks.begin(), _blocks.end() - 1);
156156
TRI_ASSERT(_blocks.size() == 1);
157157
return shadowRow;

arangod/Aql/Expression.cpp

Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
#include "Basics/StringBuffer.h"
4444
#include "Basics/VPackStringBufferAdapter.h"
4545
#include "Basics/VelocyPackHelper.h"
46+
#include "Transaction/Context.h"
4647
#include "Transaction/Helpers.h"
4748
#include "Transaction/Methods.h"
4849
#include "V8/v8-globals.h"
@@ -261,18 +262,40 @@ bool Expression::findInArray(AqlValue const& left, AqlValue const& right,
261262
}
262263
// fall-through to linear search
263264
}
264-
265+
265266
// use linear search
266-
for (size_t i = 0; i < n; ++i) {
267-
bool mustDestroy;
268-
AqlValue a = right.at(i, mustDestroy, false);
269-
AqlValueGuard guard(a, mustDestroy);
270267

271-
int compareResult = AqlValue::Compare(trx, left, a, false);
268+
if (!right.isDocvec() && !right.isRange() &&
269+
!left.isDocvec() && !left.isRange()) {
270+
// optimization for the case in which rhs is a Velocypack array, and we
271+
// can simply use a VelocyPack iterator to walk through it. this will
272+
// be a lot more efficient than using right.at(i) in case the array is
273+
// of type Compact (without any index tables)
274+
VPackSlice const lhs(left.slice());
275+
276+
VPackOptions const* options = trx->transactionContextPtr()->getVPackOptions();
277+
VPackArrayIterator it(right.slice());
278+
while (it.valid()) {
279+
int compareResult = arangodb::basics::VelocyPackHelper::compare(lhs, it.value(), false, options);
280+
281+
if (compareResult == 0) {
282+
// item found in the list
283+
return true;
284+
}
285+
it.next();
286+
}
287+
} else {
288+
for (size_t i = 0; i < n; ++i) {
289+
bool mustDestroy;
290+
AqlValue a = right.at(i, mustDestroy, false);
291+
AqlValueGuard guard(a, mustDestroy);
292+
293+
int compareResult = AqlValue::Compare(trx, left, a, false);
272294

273-
if (compareResult == 0) {
274-
// item found in the list
275-
return true;
295+
if (compareResult == 0) {
296+
// item found in the list
297+
return true;
298+
}
276299
}
277300
}
278301

arangod/Pregel/GraphStore.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,11 @@ class GraphStore final {
9898
void _storeVertices(std::vector<ShardID> const& globalShards,
9999
RangeIterator<Vertex<V,E>>& it);
100100

101-
size_t vertexSegmentSize () const {
102-
return std::ceil<size_t>( 64 * 1024 * 1024 / sizeof(Vertex<V,E>));
101+
constexpr size_t vertexSegmentSize () const {
102+
return 64 * 1024 * 1024 / sizeof(Vertex<V,E>);
103103
}
104-
size_t edgeSegmentSize() const {
105-
return std::ceil<size_t>( 64 * 1024 * 1024 / sizeof(Edge<E>));
104+
constexpr size_t edgeSegmentSize() const {
105+
return 64 * 1024 * 1024 / sizeof(Edge<E>);
106106
}
107107

108108
private:

0 commit comments

Comments
 (0)
0