This repository has been archived by the owner on Oct 12, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 422
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- The gcbenchs didn't compile due to changes in StopWatch. - I replaced the runall with a slightly more sophisticated runner - Stoping the time it takes to call system instead of stopping from within the program also measures the final GC collection. - You can run the tests with 'rdmd runbench' optionally giving a regex to match a subset of tests.
- Loading branch information
1 parent
374ccc1
commit 8fe8bab
Showing
8 changed files
with
86 additions
and
53 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,5 @@ | ||
| bin/* | ||
| obj/* | ||
| runbench | ||
| runbench.o | ||
| runbench.d.deps |
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
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 was deleted.
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
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,75 @@ | ||
| /** | ||
| * This is a driver script that runs the benchmarks. | ||
| * | ||
| * Copyright: Copyright David Simcha 2011 - 2011. | ||
| * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0) | ||
| * Authors: David Simcha | ||
| */ | ||
|
|
||
| /* Copyright David Simcha 2011 - 2011. | ||
| * Distributed under the Boost Software License, Version 1.0. | ||
| * (See accompanying file LICENSE_1_0.txt or copy at | ||
| * http://www.boost.org/LICENSE_1_0.txt) | ||
| */ | ||
| import std.datetime, std.exception, std.file, std.getopt, | ||
| std.path, std.process, std.regex, std.stdio, std.string, std.typecons; | ||
|
|
||
| // cmdline flags | ||
| bool verbose; | ||
|
|
||
| void runCmd(string cmd) | ||
| { | ||
| if (verbose) | ||
| writeln(cmd); | ||
| enforce(!system(cmd)); | ||
| } | ||
|
|
||
| void runTest(string pattern) | ||
| { | ||
| string[] sources; | ||
| auto re = regex(pattern, "g"); | ||
| auto self = buildPath(curdir, "runbench.d"); | ||
| foreach(DirEntry src; dirEntries(curdir, SpanMode.depth)) | ||
| { | ||
| if (src.isFile && !match(src.name, re).empty && | ||
| endsWith(src.name, ".d") && src.name != self) | ||
| { | ||
| sources ~= src.name; | ||
| } | ||
| } | ||
|
|
||
| foreach(ref src; sources) | ||
| { | ||
| writeln("COMPILING ", src); | ||
| auto bin = buildPath("bin", src.chomp(".d")); | ||
| runCmd("dmd -O -release -inline -op -odobj -of" ~ bin ~ " " ~ src); | ||
| src = bin; | ||
| } | ||
|
|
||
| foreach(bin; sources) | ||
| { | ||
| StopWatch sw; | ||
|
|
||
| version (Windows) | ||
| bin = bin.chompPrefix("./"); | ||
|
|
||
| writeln("RUNNING ", baseName(bin)); | ||
| sw.start; | ||
| runCmd(bin); | ||
| sw.stop; | ||
|
|
||
| auto p = sw.peek; | ||
| writefln(" took %s.%s sec.", p.seconds, p.msecs % 1000); | ||
| sw.reset; | ||
| } | ||
| } | ||
|
|
||
| void main(string[] args) { | ||
| getopt(args, | ||
| "verbose|v", &verbose, | ||
| ); | ||
|
|
||
| args = args[1 .. $]; | ||
| foreach(arg; args.length ? args : [r".*\.d"]) | ||
| runTest(arg); | ||
| } |