Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(480)

Side by Side Diff: pkg/barback/lib/src/package_graph.dart

Issue 107303004: Don't limit transformer parallelism in barback. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | pkg/barback/lib/src/pool.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library barback.package_graph; 5 library barback.package_graph;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'asset_cascade.dart'; 9 import 'asset_cascade.dart';
10 import 'asset_id.dart'; 10 import 'asset_id.dart';
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 62
63 /// The most recent error emitted from a cascade's result stream. 63 /// The most recent error emitted from a cascade's result stream.
64 /// 64 ///
65 /// This is used to pipe an unexpected error from a build to the resulting 65 /// This is used to pipe an unexpected error from a build to the resulting
66 /// [Future] returned by [getAllAssets]. 66 /// [Future] returned by [getAllAssets].
67 var _lastUnexpectedError; 67 var _lastUnexpectedError;
68 68
69 /// The stack trace for [_lastUnexpectedError]. 69 /// The stack trace for [_lastUnexpectedError].
70 StackTrace _lastUnexpectedErrorTrace; 70 StackTrace _lastUnexpectedErrorTrace;
71 71
72 // TODO(nweiz): Allow transformers to declare themselves as "lightweight" or
73 // "heavyweight" and adjust their restrictions appropriately. Simple
74 // transformers may be very efficient to run in parallel, whereas dart2js uses
75 // a lot of memory and should be run more sequentially.
76 /// A pool that controls how many transformers may be applied at once.
77 final Pool transformPool = new Pool(10);
78
79 /// Creates a new [PackageGraph] that will transform assets in all packages 72 /// Creates a new [PackageGraph] that will transform assets in all packages
80 /// made available by [provider]. 73 /// made available by [provider].
81 PackageGraph(this.provider) { 74 PackageGraph(this.provider) {
82 for (var package in provider.packages) { 75 for (var package in provider.packages) {
83 var cascade = new AssetCascade(this, package); 76 var cascade = new AssetCascade(this, package);
84 // The initial result for each cascade is "success" since the cascade 77 // The initial result for each cascade is "success" since the cascade
85 // doesn't start building until some source in that graph is updated. 78 // doesn't start building until some source in that graph is updated.
86 _cascadeResults[package] = new BuildResult.success(); 79 _cascadeResults[package] = new BuildResult.success();
87 _cascades[package] = cascade; 80 _cascades[package] = cascade;
88 cascade.onDirty.listen((_) { 81 cascade.onDirty.listen((_) {
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 if (cascade == null) throw new ArgumentError("Unknown package $package."); 185 if (cascade == null) throw new ArgumentError("Unknown package $package.");
193 cascade.removeSources(ids); 186 cascade.removeSources(ids);
194 }); 187 });
195 } 188 }
196 189
197 void updateTransformers(String package, 190 void updateTransformers(String package,
198 Iterable<Iterable<Transformer>> transformers) { 191 Iterable<Iterable<Transformer>> transformers) {
199 _cascades[package].updateTransformers(transformers); 192 _cascades[package].updateTransformers(transformers);
200 } 193 }
201 } 194 }
OLDNEW
« no previous file with comments | « no previous file | pkg/barback/lib/src/pool.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698