Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MasterDuke17/d06f051a8033e499599d05426ef33d52 to your computer and use it in GitHub Desktop.
Save MasterDuke17/d06f051a8033e499599d05426ef33d52 to your computer and use it in GitHub Desktop.
diff --git a/htmlify.p6 b/htmlify.p6
index 0a737a1..1edb598 100755
--- a/htmlify.p6
+++ b/htmlify.p6
@@ -192,11 +192,19 @@ sub process-pod-dir($dir, :&sorted-by = &[cmp], :$sparse) {
say "Processing $dir Pod files ...";
my $total = +@pod-sources;
my $kind = $dir.lc;
+ my @pod-files;
for @pod-sources.kv -> $num, (:key($filename), :value($file)) {
- printf "% 4d/%d: % -40s => %s\n", $num+1, $total, $file.path, "$kind/$filename";
- my $pod = extract-pod($file.path);
- process-pod-source :$kind, :$pod, :$filename, :pod-is-complete;
+ push @pod-files, start {
+ printf "% 4d/%d: % -40s => %s\n", $num+1, $total, $file.path, "$kind/$filename";
+ my $pod = extract-pod($file.path);
+ process-pod-source :$kind, :$pod, :$filename, :pod-is-complete;
+ }
+ if $num %% 10 {
+ await(Promise.allof(@pod-files));
+ @pod-files = ();
+ }
}
+ await(Promise.allof(@pod-files));
}
sub process-pod-source(:$kind, :$pod, :$filename, :$pod-is-complete) {
@@ -576,12 +584,16 @@ sub write-type-graph-images(:$force) {
}
}
say 'Writing type graph images to html/images/ ...';
+ my @type-graph-images;
for $type-graph.sorted -> $type {
- my $viz = Perl6::TypeGraph::Viz.new-for-type($type);
- $viz.to-file("html/images/type-graph-{$type}.svg", format => 'svg');
- $viz.to-file("html/images/type-graph-{$type}.png", format => 'png', size => '8,3');
- print '.';
+ push @type-graph-images, start {
+ my $viz = Perl6::TypeGraph::Viz.new-for-type($type);
+ $viz.to-file("html/images/type-graph-{$type}.svg", format => 'svg');
+ $viz.to-file("html/images/type-graph-{$type}.png", format => 'png', size => '8,3');
+ print '.';
+ }
}
+ await(Promise.allof(@type-graph-images));
say '';
say 'Writing specialized visualizations to html/images/ ...';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment