Re: std.experimental.randomized_unittest_benchmark is ready for comments

2016-07-09 Thread Seb via Digitalmars-d
On Sunday, 19 June 2016 at 16:15:15 UTC, Robert burner Schadek 
wrote:

Thank you Seb for taking over the review management.

Some additional feature for the proposed module is.

* Simple way to create test data for user defined types
* Benchmark data is stored into csv file for comparing the 
benchmark results between runs
* Standalone tool to create gnuplot graphs from generated csv 
benchmark files


The long time vision (2+ years) is to have a benchmark for 
every function in phobos and have the resulting graph on the 
Dlang webpage (merged PRs -> webpage). So we can track the 
performance of everything.


Just a short ping at the general public to give their comments & 
feedback ;-)


Re: std.experimental.randomized_unittest_benchmark is ready for comments

2016-06-29 Thread Jack Stouffer via Digitalmars-d
On Sunday, 19 June 2016 at 19:03:55 UTC, Robert burner Schadek 
wrote:

On Sunday, 19 June 2016 at 18:51:09 UTC, Jack Stouffer wrote:
I would like to try this out on my date parsing library, but I 
don't see a way to generate strings of a specific format.


take a look at 
https://github.com/dlang/phobos/pull/2995/files#diff-1a5f159e09980950bb9931ac674cbf40R358


just create a new Gen struct that generates what you want and 
make it a parameter to a function. And you should be done.


Hmm, isGen is failing for some reason, and I can't tell why

struct GenDateString
{
import std.format : formattedWrite;
import std.random : Random, uniform;
import std.array : appender;

string value;

void gen(ref Random gen)
{
auto app = appender!string();

app.formattedWrite(
"%s-%s-%s",
uniform!("[]")(1, 3000),
uniform!("[]")(1, 12),
uniform!("[]")(1, 28)
);

this.value = app.data;
}

ref string opCall()
{
return this.value;
}

alias opCall this;
}


Re: std.experimental.randomized_unittest_benchmark is ready for comments

2016-06-19 Thread Robert burner Schadek via Digitalmars-d

On Sunday, 19 June 2016 at 18:51:09 UTC, Jack Stouffer wrote:
I would like to try this out on my date parsing library, but I 
don't see a way to generate strings of a specific format.


take a look at 
https://github.com/dlang/phobos/pull/2995/files#diff-1a5f159e09980950bb9931ac674cbf40R358


just create a new Gen struct that generates what you want and 
make it a parameter to a function. And you should be done.


Re: std.experimental.randomized_unittest_benchmark is ready for comments

2016-06-19 Thread Jack Stouffer via Digitalmars-d
On Sunday, 19 June 2016 at 16:15:15 UTC, Robert burner Schadek 
wrote:

...


I would like to try this out on my date parsing library, but I 
don't see a way to generate strings of a specific format.


I'm think you have two options, either pass a std.format format 
string and generate random strings from that, or allow a string 
generating function to be passed.


Re: std.experimental.randomized_unittest_benchmark is ready for comments

2016-06-19 Thread Robert burner Schadek via Digitalmars-d

Thank you Seb for taking over the review management.

Some additional feature for the proposed module is.

* Simple way to create test data for user defined types
* Benchmark data is stored into csv file for comparing the 
benchmark results between runs
* Standalone tool to create gnuplot graphs from generated csv 
benchmark files


The long time vision (2+ years) is to have a benchmark for every 
function in phobos and have the resulting graph on the Dlang 
webpage (merged PRs -> webpage). So we can track the performance 
of everything.






std.experimental.randomized_unittest_benchmark is ready for comments

2016-06-19 Thread Seb via Digitalmars-d
Optimizing for performance is one of the major challenges for 
Phobos and user libraries in the next month and years. As an 
example of the benefits, have a look at the recent blog post 
about find [1].


Robert burner Schadek has proposed 
std.experimental.randomized_unittest_benchmark over a year ago. 
This addition tries to tackle two common use cases:


1) Automatically generating test data for algorithms
2) Evaluating the performance of algorithms (aka benchmarking)

The high level idea is to semi-_automatically_ generate 
benchmarks for much more methods than find which allows to check 
for regressions, find outliers and compare the performance to 
other libraries.


As the PR has been pending for so long, it would be quite helpful 
if you could take a look at the proposed addition, test it and 
give your feedback and comments.


Github PR: https://github.com/dlang/phobos/pull/2995
Dub: https://code.dlang.org/packages/std_benchmark

I will handle the review management.

[1] 
https://dlang.org/blog/index.php/2016/06/16/find-was-too-damn-slow-so-we-fixed-it/