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

RNET-1131: optimize many OR'd terms on UUID/ObjectId queries #7582

Merged
merged 6 commits into from
Apr 23, 2024

Conversation

ironage
Copy link
Contributor

@ironage ironage commented Apr 11, 2024

Fixes realm/realm-dotnet#3566

Added the ability for the UUID/ObjectId equality query node to consume conditions.
As the number of conditions increases, the outer loop to individually check each condition increases more than checking each value against a hash set of condition values. This is true even if the UUID/ObjectId property is indexed.
Screenshot 2024-04-11 at 11 12 59 AM

Benchmark results as compared to the same benchmarks on master:

./test/benchmark-common-tasks/realm-benchmark-common-tasks visible ".*ChainedOr.*"
Results path: visible
Req runs:  145  QueryChainedOrStrings (MemOnly, EncryptionOff):     min   3.37ms (+0.05%)            max   3.72ms (+0.96%)            med   3.42ms (+0.02%)            avg   3.45ms (-0.20%)            stddev    73us (-12.42%)

Req runs:  366  QueryChainedOrStringsIndexed (MemOnly, EncryptionOff):     min   1.32ms (+0.37%)            max   1.54ms (+0.69%)            med   1.35ms (-0.22%)            avg   1.36ms (+0.06%)            stddev    32us (+4.05%)

Req runs:   17  QueryChainedOrStringsViewFilterPredicate (MemOnly, EncryptionOff):     min  28.14ms (+0.37%)            max  28.68ms (+0.61%)            med  28.35ms (+0.30%)            avg  28.33ms (+0.27%)            stddev   145us (+13.24%)

Req runs:   79  QueryNotChainedOrStrings (MemOnly, EncryptionOff):                     min   6.09ms (-0.30%)            max   6.82ms (+1.20%)            med   6.40ms (+1.75%)            avg   6.39ms (+1.19%)            stddev   188us (+30.81%)

Req runs:   79  QueryNotChainedOrStringsIndexed (MemOnly, EncryptionOff):              min   6.12ms (+0.36%)            max   6.74ms (-0.92%)            med   6.37ms (+1.39%)            avg   6.38ms (+0.88%)            stddev   145us (-16.76%)

Req runs:  538  QueryChainedOrInts (MemOnly, EncryptionOff):                           min    914us (+3.84%)            max   1.05ms (+1.50%)            med    924us (+3.49%)            avg    931us (+3.55%)            stddev    22us (+30.71%)

Req runs:  536  QueryChainedOrIntsIndexed (MemOnly, EncryptionOff):                    min    915us (-94.71%)           max   1.07ms (-94.03%)           med    926us (-94.74%)           avg    935us (-94.68%)           stddev    27us (-89.80%)

Req runs:  575  QueryChainedOrIntsCount (MemOnly, EncryptionOff):                      min    854us (+4.24%)            max   1.01ms (+4.14%)            med    862us (+4.24%)            avg    869us (+4.04%)            stddev    21us (-13.79%)

Req runs:  454  QueryChainedOrEquality_10<uuid><NonNullable><Indexed> (MemOnly, EncryptionOff):     min   1.07ms (+2.21%)            max   1.25ms (-3.20%)            med   1.08ms (+1.87%)            avg   1.09ms (+1.87%)            stddev    28us (-13.63%)

Req runs:  458  QueryChainedOrEquality_20<uuid><NonNullable><Indexed> (MemOnly, EncryptionOff):     min   1.07ms (+2.23%)            max   1.49ms (+19.73%)           med   1.08ms (+1.80%)            avg   1.10ms (+2.52%)            stddev    46us (+60.16%)

Req runs:  446  QueryChainedOrEquality_40<uuid><NonNullable><Indexed> (MemOnly, EncryptionOff):     min   1.07ms (+2.15%)            max   1.34ms (+2.75%)            med   1.09ms (+2.29%)            avg   1.11ms (+2.97%)            stddev    45us (+26.27%)

Req runs:  279  QueryChainedOrEquality_80<uuid><NonNullable><Indexed> (MemOnly, EncryptionOff):     min   1.74ms (+2.18%)            max   2.04ms (-0.21%)            med   1.78ms (+2.17%)            avg   1.80ms (+1.72%)            stddev    55us (-13.90%)

Req runs:  144  QueryChainedOrEquality_160<uuid><NonNullable><Indexed> (MemOnly, EncryptionOff):     min   3.37ms (-2.56%)            max   3.85ms (-2.75%)            med   3.44ms (-3.27%)            avg   3.47ms (-3.27%)            stddev    92us (-16.19%)

Req runs:  114  QueryChainedOrEquality_320<uuid><NonNullable><Indexed> (MemOnly, EncryptionOff):     min   4.28ms (-41.59%)           max   4.74ms (-42.17%)           med   4.39ms (-42.23%)           avg   4.41ms (-42.15%)           stddev    95us (-51.75%)

Req runs:   79  QueryChainedOrEquality_640<uuid><NonNullable><Indexed> (MemOnly, EncryptionOff):     min   6.05ms (-62.76%)           max   6.79ms (-62.15%)           med   6.20ms (-62.41%)           avg   6.25ms (-62.48%)           stddev   163us (-59.54%)

Req runs:   50  QueryChainedOrEquality_1280<uuid><NonNullable><Indexed> (MemOnly, EncryptionOff):     min   9.42ms (-71.36%)           max  10.21ms (-70.60%)           med   9.64ms (-71.01%)           avg   9.73ms (-70.83%)           stddev   248us (-53.94%)

Req runs:   29  QueryChainedOrEquality_2560<uuid><NonNullable><Indexed> (MemOnly, EncryptionOff):     min  16.25ms (-76.86%)           max  17.24ms (-76.31%)           med  16.40ms (-76.83%)           avg  16.46ms (-76.87%)           stddev   241us (-76.59%)

Req runs:   16  QueryChainedOrEquality_5120<uuid><NonNullable><Indexed> (MemOnly, EncryptionOff):     min  29.39ms (-81.73%)           max  30.97ms (-80.99%)           med  29.52ms (-81.81%)           avg  29.76ms (-81.64%)           stddev   486us (-44.23%)

Req runs:    8  QueryChainedOrEquality_10240<uuid><NonNullable><Indexed> (MemOnly, EncryptionOff):     min  54.94ms (-85.97%)           max  55.87ms (-85.97%)           med  55.38ms (-86.00%)           avg  55.36ms (-85.98%)           stddev   327us (-88.76%)

Req runs:    5  QueryChainedOrEquality_20480<uuid><NonNullable><Indexed> (MemOnly, EncryptionOff):     min 104.53ms (-89.76%)           max 109.13ms (-89.39%)           med 104.98ms (-89.77%)           avg 105.81ms (-89.68%)           stddev  1.93ms (-38.10%)

Req runs:   17  QueryChainedOrEquality_5000<uuid><NonNullable><Indexed> (MemOnly, EncryptionOff):      min  28.66ms (-81.49%)           max  30.39ms (-80.89%)           med  29.54ms (-81.12%)           avg  29.65ms (-81.08%)           stddev   489us (-72.39%)

Req runs:    5  QueryChainedOrEquality_5000<objectId><NonNullable><Indexed> (MemOnly, EncryptionOff):     min 192.98ms (-94.87%)           max 194.59ms (-94.90%)           med 193.14ms (-94.91%)           avg 193.42ms (-94.90%)           stddev   660us (-97.33%)

Req runs:   20  QueryChainedOrEquality_5000<uuid><NonNullable><NonIndexed> (MemOnly, EncryptionOff):      min  23.80ms (-97.72%)           max  25.82ms (-97.54%)           med  24.58ms (-97.65%)           avg  24.66ms (-97.65%)           stddev   487us (-55.60%)

Req runs:    5  QueryChainedOrEquality_5000<objectId><NonNullable><NonIndexed> (MemOnly, EncryptionOff):     min 138.12ms (-96.81%)           max 139.15ms (-96.80%)           med 138.65ms (-96.81%)           avg 138.56ms (-96.81%)           stddev   430us (-94.27%)

☑️ ToDos

  • 📝 Changelog update
  • 🚦 Tests (or not relevant)
  • C-API, if public C++ API changed
  • bindgen/spec.yml, if public C++ API changed

@ironage ironage self-assigned this Apr 11, 2024
@cla-bot cla-bot bot added the cla: yes label Apr 11, 2024
@ironage ironage requested a review from jedelbo April 11, 2024 18:19
@ironage ironage changed the title RNET-3566: optimize many OR'd terms on UUID/ObjectId queries RNET-1131: optimize many OR'd terms on UUID/ObjectId queries Apr 11, 2024
Copy link

coveralls-official bot commented Apr 11, 2024

Pull Request Test Coverage Report for Build james.stone_528

Details

  • 308 of 330 (93.33%) changed or added relevant lines in 6 files are covered.
  • 134 unchanged lines in 14 files lost coverage.
  • Overall coverage decreased (-0.01%) to 91.786%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/realm/query_engine.cpp 17 19 89.47%
src/realm/query.cpp 68 75 90.67%
src/realm/query_engine.hpp 120 133 90.23%
Files with Coverage Reduction New Missed Lines %
src/realm/query_engine.hpp 1 93.85%
test/test_index_string.cpp 1 94.63%
src/realm/query_expression.cpp 2 87.17%
src/realm/sync/network/http.hpp 2 82.41%
src/realm/sync/noinst/client_impl_base.cpp 2 85.88%
src/realm/table_view.cpp 2 94.18%
test/test_lang_bind_helper.cpp 2 94.24%
src/realm/table.cpp 3 90.83%
src/realm/mixed.cpp 4 84.79%
src/realm/util/file.cpp 5 80.97%
Totals Coverage Status
Change from base Build 2246: -0.01%
Covered Lines: 243912
Relevant Lines: 265741

💛 - Coveralls

void combine_conditions(bool ignore_indexes)
{
// Although ColKey is not unique per table, it is not important to consider
// the table when sorting here because
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

incomplete sentence

struct ConditionType {
ConditionType(const ParentNode* node)
: m_col(node->m_condition_column_key.value)
, m_type_hash(typeid(node).hash_code())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no guarantee that type_info::hash_code() is distinct for different types (e.g. return 0; is a legal implementation), so comparing only the hashes doesn't work. There doesn't appear to be any reason to use the hash code, though, as type_info supports ordering (via before()) and equality comparisons directly.

Copy link
Contributor

@jedelbo jedelbo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure how we should deal with the problem that Thomas points out. I can see that including the type_info directly in the ConditionType makes it hard to use in the FlatMap.
Otherwise very nice.

@@ -84,7 +84,7 @@ inline ObjectId TestValueGenerator::convert_for_test<ObjectId>(int64_t v)
uint64_t cur = static_cast<uint64_t>(v);
for (size_t i = 0; i < 24; ++i) {
value += char(hex_digits[cur % 16]);
cur -= (cur % 16);
cur = cur >> 1;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test code is used in the benchmarks and was generating many of the same values because as soon as a value is a multiple of 16 we'd subtract 0 which left all remaining values filled with 0s. This skewed results. It might affect a few of the other ObjectId benchmarks a bit compared to our historic results, but is much more realistic.

std::sort(m_conditions.begin(), m_conditions.end(), [](auto& a, auto& b) {
return a->m_condition_column_key < b->m_condition_column_key;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The previous sorting code didn't consider the node type in the sort. This might have led to the query not being optimized/combined even if it should have been. The affected queries would have multiple conditions on the same column such as c == 1 or c == 2 or c == 3 or c > 5. If the sort put the c > 5 node between any of the == nodes, then not all of the equality nodes would have been combined. The query would have evaluated correctly, just not at peak performance, so I don't think it is worth a changelog note.

{
}
int64_t m_col;
std::type_index m_type;
Copy link
Contributor Author

@ironage ironage Apr 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've changed to use a std::type_index which I think should be more robust than using the hash.

@ironage
Copy link
Contributor Author

ironage commented Apr 19, 2024

I have added an optimization for RQL IN queries as well. Updated performance numbers when compared to master:

james.stone@M-V09PH6XMGG:/Users/james.stone/Documents/code/realm-core2/build.ninja.release git:(js/perf-uuid*) $ ./test/benchmark-common-tasks/realm-benchmark-common-tasks new-base "Query.*"
Results path: new-base
Req runs:  542  Query (MemOnly, EncryptionOff):               min    869us (+0.09%)            max   1.03ms (+13.06%)         * med    924us (+6.38%)          * avg    920us (+5.40%)            stddev    13us (+34.53%)
Req runs:  725  QueryNot (MemOnly, EncryptionOff):            min    647us (+7.74%)            max    946us (+19.69%)           med    683us (+7.68%)            avg    689us (+7.31%)            stddev    27us (+4.46%)
Req runs: 1000  QueryLongString (MemOnly, EncryptionOff):   * min    100us (+9.54%)            max    115us (+6.70%)          * med    102us (+11.03%)         * avg    102us (+11.11%)           stddev     1us (+21.46%)
Req runs:    5  QueryInsensitiveString (MemOnly, EncryptionOff):     min 998.34ms (-2.44%)            max 1003.09ms (-2.69%)            med 1000.55ms (-2.37%)            avg 1000.42ms (-2.57%)            stddev  1.99ms (-44.87%)
Req runs:  224  QueryInsensitiveStringIndexed (MemOnly, EncryptionOff):     min   1.03ms (+3.46%)            max  12.94ms (+0.08%)            med   2.15ms (+2.72%)            avg   2.27ms (+2.87%)            stddev  1.28ms (+2.64%)
Req runs:  143  QueryChainedOrStrings (MemOnly, EncryptionOff):             min   3.37ms (+0.19%)            max   3.82ms (+9.55%)          * med   3.55ms (+5.42%)          * avg   3.55ms (+5.36%)            stddev    88us (+436.49%)
Req runs:  367  QueryChainedOrStringsIndexed (MemOnly, EncryptionOff):      min   1.30ms (+0.06%)            max   1.51ms (+8.32%)            med   1.31ms (-0.16%)            avg   1.33ms (+0.92%)            stddev    36us (+213.49%)
Req runs:   17  QueryChainedOrStringsViewFilterPredicate (MemOnly, EncryptionOff):     min  27.93ms (+0.35%)            max  29.27ms (+3.69%)            med  27.99ms (+0.32%)            avg  28.15ms (+0.74%)            stddev   344us (+177.64%)
Req runs:   79  QueryNotChainedOrStrings (MemOnly, EncryptionOff):                     min   6.09ms (+0.84%)            max   6.64ms (+1.92%)            med   6.25ms (+2.61%)            avg   6.29ms (+3.00%)            stddev   162us (+131.58%)
Req runs:   80  QueryNotChainedOrStringsIndexed (MemOnly, EncryptionOff):              min   6.12ms (+0.84%)            max   7.41ms (+15.37%)           med   6.17ms (+0.69%)            avg   6.24ms (+1.79%)            stddev   194us (+287.61%)
Req runs:  558  QueryChainedOrInts (MemOnly, EncryptionOff):                           min    888us (+1.04%)            max    975us (+6.35%)            med    891us (+0.83%)            avg    893us (+0.93%)            stddev     7us (+35.24%)
Req runs:  561  QueryChainedOrIntsIndexed (MemOnly, EncryptionOff):                    min    887us (-94.70%)           max    921us (-94.59%)           med    889us (-94.71%)           avg    890us (-94.71%)           stddev     3us (-94.72%)
Req runs:  604  QueryChainedOrIntsCount (MemOnly, EncryptionOff):                      min    822us (+0.52%)            max    883us (-1.74%)            med    826us (+0.57%)            avg    831us (+1.02%)            stddev    11us (+56.73%)
Req runs:    5  QueryIntEquality (MemOnly, EncryptionOff):                           * min  96.78ms (+0.89%)            max  96.93ms (+0.74%)          * med  96.79ms (+0.81%)          * avg  96.83ms (+0.84%)            stddev    71us (-38.46%)
Req runs:  972  QueryIntEqualityIndexed (MemOnly, EncryptionOff):                      min    508us (-0.41%)            max    560us (-10.47%)           med    511us (-0.19%)            avg    512us (-0.51%)            stddev     4us (-52.99%)
Req runs:   13  QueryWithForeignAggAvg (MemOnly, EncryptionOff):                       min  35.28ms (+0.03%)            max  35.66ms (+0.34%)            med  35.30ms (-0.04%)            avg  35.33ms (-0.05%)            stddev   102us (+13.97%)
Req runs: 1000  QueryIntsVsDoubleColumns (MemOnly, EncryptionOff):                     min      0us (-25.00%)           max      2us (+390.00%)          med      0us (+0.00%)            avg      0us (+0.07%)            stddev     0us (+86.47%)
Req runs: 1000  QueryStringOverLinks (MemOnly, EncryptionOff):                         min    194us (+0.56%)            max    215us (-4.65%)            med    195us (+0.73%)            avg    195us (+0.37%)            stddev     1us (-60.37%)
Req runs:  608  QueryEqual<mixed><NonNullable><Indexed> (MemOnly, EncryptionOff):      min    796us (-34.78%)           max   1.14ms (-12.32%)           med    925us (-26.23%)           avg    933us (-25.06%)           stddev    71us (+297.34%)
Req runs:    5  QueryEqual<mixed><NonNullable><NonIndexed> (MemOnly, EncryptionOff):     min  86.87ms (-0.86%)            max  87.13ms (-1.63%)            med  86.91ms (-1.17%)            avg  86.96ms (-1.24%)            stddev   108us (-73.98%)
Req runs: 1000  QueryEqual<uuid><NonNullable><Indexed> (MemOnly, EncryptionOff):         min     40us (+0.83%)            max     44us (-9.67%)            med     41us (+0.82%)            avg     41us (+0.59%)            stddev     0us (-49.86%)
Req runs:   48  QueryEqual<uuid><NonNullable><NonIndexed> (MemOnly, EncryptionOff):      min  10.24ms (+0.07%)            max  10.56ms (+0.28%)            med  10.25ms (+0.05%)            avg  10.26ms (+0.03%)            stddev    50us (+0.58%)
Req runs: 1000  QueryEqual<objectId><NonNullable><Indexed> (MemOnly, EncryptionOff):     min     42us (-98.21%)           max     45us (-98.22%)           med     42us (-98.22%)           avg     43us (-98.21%)           stddev     0us (-98.87%)
Req runs:   54  QueryEqual<objectId><NonNullable><NonIndexed> (MemOnly, EncryptionOff):     min   9.17ms (-39.89%)           max   9.36ms (-39.87%)           med   9.18ms (-40.35%)           avg   9.19ms (-40.26%)           stddev    25us (-61.29%)
Req runs: 1000  QueryEqual<timestamp><NonNullable><Indexed> (MemOnly, EncryptionOff):       min     46us (+0.27%)            max     50us (-13.72%)           med     47us (+0.45%)            avg     47us (+0.14%)            stddev     0us (-61.38%)
Req runs:   81  QueryEqual<timestamp><NonNullable><NonIndexed> (MemOnly, EncryptionOff):     min   6.11ms (+0.08%)            max   6.37ms (+3.46%)            med   6.12ms (-0.02%)            avg   6.14ms (+0.29%)            stddev    55us (+342.69%)
Req runs: 1000  QueryEqual<int><NonNullable><Indexed> (MemOnly, EncryptionOff):              min     39us (+0.00%)            max     43us (-23.23%)           med     40us (+0.21%)            avg     40us (+0.13%)            stddev     0us (-46.41%)
Req runs: 1000  QueryEqual<string><NonNullable><Indexed> (MemOnly, EncryptionOff):           min     44us (-0.66%)            max     48us (-33.00%)           med     45us (-0.74%)            avg     45us (-1.25%)            stddev     0us (-77.34%)
Req runs:   19  QueryEqual<bool><NonNullable><Indexed> (MemOnly, EncryptionOff):             min  22.98ms (-2.96%)            max  25.33ms (+4.25%)            med     25ms (+4.62%)            avg  24.57ms (+2.76%)            stddev   843us (+477.12%)
Req runs:    8  QueryEqual<bool><NonNullable><NonIndexed> (MemOnly, EncryptionOff):          min  59.46ms (+1.54%)            max  62.16ms (+1.73%)          * med  61.64ms (+3.13%)          * avg  61.45ms (+3.10%)            stddev   825us (-1.16%)
Req runs:    5  QueryInsensitiveEqual<mixed><NonNullable><NonIndexed> (MemOnly, EncryptionOff):     min 158.90ms (-0.95%)            max 159.64ms (-0.81%)            med 159.27ms (-0.86%)            avg 159.29ms (-0.87%)            stddev   344us (+38.81%)
Req runs:  528  QueryInsensitiveEqual<mixed><NonNullable><Indexed> (MemOnly, EncryptionOff):        min    911us (-23.02%)           max   1.09ms (-26.72%)           med    972us (-21.08%)           avg    946us (-23.68%)           stddev    32us (-29.87%)
Req runs:    7  QueryInsensitiveEqual<string><NonNullable><NonIndexed> (MemOnly, EncryptionOff):     min  63.33ms (-0.06%)            max  63.99ms (-6.77%)            med  63.37ms (-6.15%)            avg  63.47ms (-5.07%)            stddev   238us (-88.35%)
Req runs: 1000  QueryInsensitiveEqual<string><NonNullable><Indexed> (MemOnly, EncryptionOff):        min     61us (-1.15%)            max     83us (-6.45%)            med     62us (-5.70%)            avg     63us (-5.53%)            stddev     1us (-67.71%)
Req runs:   16  QueryChainedOrEquality_5000<uuid><NonNullable><Indexed> (MemOnly, EncryptionOff):     min  29.56ms (-80.43%)           max  29.96ms (-81.45%)           med  29.73ms (-80.45%)           avg  29.73ms (-80.82%)           stddev   125us (-97.38%)
Req runs:   16  QueryChainedOrEquality_5000<objectId><NonNullable><Indexed> (MemOnly, EncryptionOff):     min  30.05ms (-99.19%)           max  30.75ms (-99.19%)           med  30.15ms (-99.20%)           avg  30.22ms (-99.19%)           stddev   191us (-99.30%)
Req runs:   19  QueryChainedOrEquality_5000<uuid><NonNullable><NonIndexed> (MemOnly, EncryptionOff):      min  24.87ms (-97.61%)           max  25.52ms (-97.57%)           med  25.08ms (-97.60%)           avg  25.07ms (-97.60%)           stddev   164us (-95.40%)
Req runs:   20  QueryChainedOrEquality_5000<objectId><NonNullable><NonIndexed> (MemOnly, EncryptionOff):     min  24.70ms (-99.42%)           max  25.21ms (-99.42%)           med  24.76ms (-99.42%)           avg  24.79ms (-99.42%)           stddev   114us (-98.68%)
Req runs:  113  QueryParsedIN_5000<uuid><NonNullable><Indexed> (MemOnly, EncryptionOff):                     min   4.35ms (-99.91%)           max   4.59ms (-99.91%)           med   4.37ms (-99.91%)           avg   4.38ms (-99.91%)           stddev    26us (-99.50%)
Req runs:  116  QueryParsedIN_5000<objectId><NonNullable><Indexed> (MemOnly, EncryptionOff):                 min   4.26ms (-97.76%)           max   4.42ms (-97.70%)           med   4.28ms (-97.76%)           avg   4.28ms (-97.76%)           stddev    27us (-96.07%)
Req runs:   35  QueryParsedIN_5000<uuid><NonNullable><NonIndexed> (MemOnly, EncryptionOff):                  min  13.85ms (-99.72%)           max  13.94ms (-99.72%)           med  13.88ms (-99.72%)           avg  13.88ms (-99.72%)           stddev    19us (-99.27%)
Req runs:   34  QueryParsedIN_5000<objectId><NonNullable><NonIndexed> (MemOnly, EncryptionOff):              min  13.80ms (-89.86%)           max  14.42ms (-89.59%)           med  13.84ms (-89.89%)           avg  13.89ms (-89.86%)           stddev   143us (-85.84%)
Req runs: 1000  QueryParsedIN_5<uuid><NonNullable><Indexed> (MemOnly, EncryptionOff):                        min     45us (-99.90%)           max     51us (-99.89%)           med     45us (-99.90%)           avg     45us (-99.90%)           stddev     0us (-99.27%)
Req runs: 1000  QueryParsedIN_5<objectId><NonNullable><Indexed> (MemOnly, EncryptionOff):                    min     42us (-99.98%)           max     45us (-99.98%)           med     42us (-99.98%)           avg     42us (-99.98%)           stddev     0us (-99.92%)
Req runs:  235  QueryParsedIN_5<uuid><NonNullable><NonIndexed> (MemOnly, EncryptionOff):                     min   2.12ms (-95.18%)           max   2.22ms (-94.97%)           med   2.12ms (-95.17%)           avg   2.13ms (-95.17%)           stddev    10us (-56.55%)
Req runs:  212  QueryParsedIN_5<objectId><NonNullable><NonIndexed> (MemOnly, EncryptionOff):                 min   2.33ms (-98.24%)           max   2.54ms (-98.10%)           med   2.34ms (-98.24%)           avg   2.35ms (-98.24%)           stddev    17us (-94.15%)
Req runs:   10  QueryRange<int><NonNullable><NonIndexed> (MemOnly, EncryptionOff):                           min  48.34ms (-0.80%)            max  48.56ms (-0.72%)            med  48.45ms (-0.68%)            avg  48.44ms (-0.74%)            stddev    72us (+9.48%)
Req runs:   22  QueryTimestampGreaterOverLinks (MemOnly, EncryptionOff):                                     min  22.27ms (-0.25%)            max  23.14ms (+0.76%)            med  22.40ms (-0.17%)            avg  22.49ms (+0.18%)            stddev   223us (+69.49%)
Req runs:  522  QueryTimestampGreater (MemOnly, EncryptionOff):                                              min    904us (-0.29%)            max   1.81ms (+60.66%)           med    979us (+0.03%)            avg    957us (+0.84%)            stddev    62us (+59.56%)
Req runs:  535  QueryTimestampGreaterEqual (MemOnly, EncryptionOff):                                         min    905us (-0.23%)            max   1004us (-7.42%)            med    945us (-3.55%)            avg    935us (-1.69%)            stddev    27us (-32.07%)
Req runs:  523  QueryTimestampLess (MemOnly, EncryptionOff):                                                 min    906us (-1.06%)            max   1.15ms (-26.26%)           med    966us (+0.22%)            avg    960us (+0.16%)            stddev    51us (+8.26%)
Req runs:  523  QueryTimestampLessEqual (MemOnly, EncryptionOff):                                            min    905us (-1.07%)            max   1.12ms (-38.21%)           med    996us (+0.64%)            avg    958us (-0.63%)            stddev    49us (-11.95%)
Req runs: 1000  QueryTimestampEqual (MemOnly, EncryptionOff):                                                min    126us (+0.23%)            max    145us (-2.19%)            med    126us (+0.23%)            avg    127us (+0.04%)            stddev     1us (-50.07%)
Req runs:  353  QueryTimestampNotEqual (MemOnly, EncryptionOff):                                             min   1.37ms (+8.92%)            max   2.93ms (+66.13%)           med   1.40ms (+7.75%)            avg   1.42ms (+8.33%)            stddev   130us (+129.01%)
Req runs:  312  QueryTimestampNotNull (MemOnly, EncryptionOff):                                              min   1.54ms (-2.30%)            max   2.15ms (+28.38%)           med   1.57ms (-1.61%)            avg   1.59ms (-0.43%)            stddev    50us (+273.68%)
Req runs: 1000  QueryTimestampEqualNull (MemOnly, EncryptionOff):                                            min    445us (-1.77%)            max    514us (+1.70%)            med    472us (-0.14%)            avg    464us (-0.28%)            stddev    17us (+68.63%)
Req runs:   17  QueryListOfPrimitiveIntsSize (MemOnly, EncryptionOff):                                       min  28.05ms (+0.05%)            max  28.54ms (+1.01%)            med  28.08ms (-0.04%)            avg  28.13ms (+0.10%)            stddev   127us (+157.58%)

@ironage ironage requested a review from jedelbo April 19, 2024 19:03
@ironage
Copy link
Contributor Author

ironage commented Apr 19, 2024

@jedelbo could I please get your re-review on the last commit?

Copy link
Contributor

@jedelbo jedelbo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few non-blocking details.

src/realm/query.cpp Outdated Show resolved Hide resolved
src/realm/query_engine.cpp Outdated Show resolved Hide resolved
@ironage ironage merged commit eef7fcf into master Apr 23, 2024
36 of 39 checks passed
@ironage ironage deleted the js/perf-uuid branch April 23, 2024 23:50
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Very slow deletion, multiple objects
3 participants