Skip to content

Commit

Permalink
10 times more objects, 10 times fewer queries in indexed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nielsenko committed Mar 18, 2024
1 parent 546c967 commit 22c7c54
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/realm_dart/test/indexed_test.dart
Expand Up @@ -92,7 +92,7 @@ void main() {
test('Indexed faster: ${testCase.name}', () {
final config = Configuration.local([WithIndexes.schema, NoIndexes.schema]);
final realm = getRealm(config);
const max = 10000;
const max = 100000;
final allIndexed = realm.all<WithIndexes>();
final allNotIndexed = realm.all<NoIndexes>();
expect(allIndexed.length, 0);
Expand Down Expand Up @@ -130,7 +130,7 @@ void main() {

// Inefficient, but fast enough for this test
final halfMax = max ~/ 2;
final searchOrder = (List.generate(halfMax, (i) => halfMax + i)..shuffle(Random(42))).map((i) => testCase.factory(i)).take(1000).toList();
final searchOrder = (List.generate(halfMax, (i) => halfMax + i)..shuffle(Random(42))).map((i) => testCase.factory(i)).take(100).toList();

@pragma('vm:no-interrupts')
Duration measureSpeed<T extends RealmObject>(RealmResults<T> results) {
Expand Down

0 comments on commit 22c7c54

Please sign in to comment.