-
Notifications
You must be signed in to change notification settings - Fork 212
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP, not for submit: benchmark analyzer-based generation / incrementa…
…l generation by number of files.
- Loading branch information
1 parent
998d544
commit e1d7079
Showing
5 changed files
with
145 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import 'dart:io'; | ||
|
||
import '../test/common/utils.dart'; | ||
|
||
Future<void> main() async { | ||
// only works in test | ||
inTest = false; | ||
ensureCleanGitClient(); | ||
print('Initial build.'); | ||
await runBuild(); | ||
print('Done.'); | ||
|
||
print('Files,Build time/ms'); | ||
for (final size in [ | ||
100, | ||
500, | ||
1000, | ||
1500, | ||
2000, | ||
2500, | ||
3000, | ||
3500, | ||
4000, | ||
4500, | ||
5000, | ||
]) { | ||
stdout.write('$size,'); | ||
|
||
for (var i = 0; i != size; ++i) { | ||
await createFile('lib/built_value${i + 1}.dart', ''' | ||
import 'package:built_value/built_value.dart'; | ||
part 'built_value${i + 1}.g.dart'; | ||
abstract class Value implements Built<Value, ValueBuilder> { | ||
Value._(); | ||
factory Value([void Function(ValueBuilder)? updates]) = _\$Value; | ||
} | ||
'''); | ||
} | ||
await runBuild(); | ||
await createFile('lib/built_value1.dart', ''' | ||
import 'package:built_value/built_value.dart'; | ||
part 'built_value1.g.dart'; | ||
abstract class Value implements Built<Value, ValueBuilder> { | ||
int get x; | ||
Value._(); | ||
factory Value([void Function(ValueBuilder)? updates]) = _\$Value; | ||
} | ||
'''); | ||
final stopwatch = Stopwatch()..start(); | ||
await runBuild(); | ||
print(stopwatch.elapsedMilliseconds); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import 'package:built_value/built_value.dart'; | ||
|
||
|
||
|
||
part 'built_value1.g.dart'; | ||
|
||
abstract class Value implements Built<Value, ValueBuilder> { | ||
Value._(); | ||
factory Value([void Function(ValueBuilder)? updates]) = _$Value; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters