File tree Expand file tree Collapse file tree 3 files changed +24
-2
lines changed Expand file tree Collapse file tree 3 files changed +24
-2
lines changed Original file line number Diff line number Diff line change 22// for details. All rights reserved. Use of this source code is governed by a
33// BSD-style license that can be found in the LICENSE file.
44
5+ import 'dart:io' ;
56import 'dart:math' ;
67
78import 'package:_pub_shared/search/search_form.dart' ;
@@ -23,13 +24,15 @@ final queries = [
2324];
2425
2526Future <void > main (List <String > args) async {
26- print ('Loading...' );
27+ print ('Started. Current memory: ${ProcessInfo .currentRss ~/ 1024 } KiB, '
28+ 'max memory: ${ProcessInfo .maxRss ~/ 1024 } KiB' );
2729 final primaryRunner = await startSearchIsolate (snapshot: args.first);
2830 final reducedRunner = await startSearchIsolate (
2931 snapshot: args.first,
3032 removeTextContent: true ,
3133 );
32- print ('Loaded.' );
34+ print ('Loaded. Current memory: ${ProcessInfo .currentRss ~/ 1024 } KiB, '
35+ 'max memory: ${ProcessInfo .maxRss ~/ 1024 } KiB' );
3336
3437 for (var i = 0 ; i < 5 ; i++ ) {
3538 await _benchmark (primaryRunner, primaryRunner);
@@ -39,6 +42,8 @@ Future<void> main(List<String> args) async {
3942
4043 await primaryRunner.close ();
4144 await reducedRunner.close ();
45+ print ('Done. Current memory: ${ProcessInfo .currentRss ~/ 1024 } KiB, '
46+ 'max memory: ${ProcessInfo .maxRss ~/ 1024 } KiB' );
4247}
4348
4449Future <void > _benchmark (IsolateRunner primary, IsolateRunner reduced) async {
Original file line number Diff line number Diff line change 22// for details. All rights reserved. Use of this source code is governed by a
33// BSD-style license that can be found in the LICENSE file.
44
5+ import 'dart:io' ;
6+
57import 'package:pub_dev/search/sdk_mem_index.dart' ;
68
79/// Loads a Dart SDK search snapshot and executes queries on it, benchmarking their total time to complete.
810Future <void > main () async {
11+ print ('Started. Current memory: ${ProcessInfo .currentRss ~/ 1024 } KiB, '
12+ 'max memory: ${ProcessInfo .maxRss ~/ 1024 } KiB' );
913 final index = await createSdkMemIndex ();
14+ print ('Loaded. Current memory: ${ProcessInfo .currentRss ~/ 1024 } KiB, '
15+ 'max memory: ${ProcessInfo .maxRss ~/ 1024 } KiB' );
1016
1117 // NOTE: please add more queries to this list, especially if there is a performance bottleneck.
1218 final queries = [
@@ -25,4 +31,6 @@ Future<void> main() async {
2531 }
2632 sw.stop ();
2733 print ('${(sw .elapsedMilliseconds / count ).toStringAsFixed (2 )} ms/request' );
34+ print ('Done. Current memory: ${ProcessInfo .currentRss ~/ 1024 } KiB, '
35+ 'max memory: ${ProcessInfo .maxRss ~/ 1024 } KiB' );
2836}
Original file line number Diff line number Diff line change 22// for details. All rights reserved. Use of this source code is governed by a
33// BSD-style license that can be found in the LICENSE file.
44
5+ import 'dart:async' ;
6+ import 'dart:io' ;
7+
58import 'package:_pub_shared/search/search_form.dart' ;
69import 'package:pub_dev/search/search_service.dart' ;
710import 'package:pub_dev/search/updater.dart' ;
811
912/// Loads a search snapshot and executes queries on it, benchmarking their total time to complete.
1013Future <void > main (List <String > args) async {
14+ print ('Started. Current memory: ${ProcessInfo .currentRss ~/ 1024 } KiB, '
15+ 'max memory: ${ProcessInfo .maxRss ~/ 1024 } KiB' );
1116 // Assumes that the first argument is a search snapshot file.
1217 final index = await loadInMemoryPackageIndexFromFile (args.first);
18+ print ('Loaded. Current memory: ${ProcessInfo .currentRss ~/ 1024 } KiB, '
19+ 'max memory: ${ProcessInfo .maxRss ~/ 1024 } KiB' );
1320
1421 // NOTE: please add more queries to this list, especially if there is a performance bottleneck.
1522 final queries = [
@@ -34,4 +41,6 @@ Future<void> main(List<String> args) async {
3441 }
3542 sw.stop ();
3643 print ('${(sw .elapsedMilliseconds / count ).toStringAsFixed (2 )} ms/request' );
44+ print ('Done. Current memory: ${ProcessInfo .currentRss ~/ 1024 } KiB, '
45+ 'max memory: ${ProcessInfo .maxRss ~/ 1024 } KiB' );
3746}
You can’t perform that action at this time.
0 commit comments