Skip to content

Commit 609e484

Browse files
Generate index.md from README.md
1 parent 7484488 commit 609e484

File tree

4 files changed

+42
-353
lines changed

4 files changed

+42
-353
lines changed

README.md

Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,37 @@
1-
<h3 align="center">
1+
<div align="center">
22

3-
![](docs/logo/logo-wide.png)
3+
![](https://raw.githubusercontent.com/dotnet/BenchmarkDotNet/ec962b0bd6854c991d7a3ebd77037579165acb36/docs/logo/logo-wide.png)
44

5-
</h3>
5+
</div>
66

7-
<h3 align="center">
7+
<div align="center">
88

99
[![NuGet](https://img.shields.io/nuget/v/BenchmarkDotNet.svg)](https://www.nuget.org/packages/BenchmarkDotNet/)
1010
[![Downloads](https://img.shields.io/nuget/dt/benchmarkdotnet.svg)](https://www.nuget.org/packages/BenchmarkDotNet/)
1111
[![Stars](https://img.shields.io/github/stars/dotnet/BenchmarkDotNet?color=brightgreen)](https://github.com/dotnet/BenchmarkDotNet/stargazers)
12-
[![Gitter](https://img.shields.io/gitter/room/dotnet/BenchmarkDotNet?color=yellow)](https://gitter.im/dotnet/BenchmarkDotNet)
13-
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE.md)
14-
[![Twitter](https://img.shields.io/twitter/follow/BenchmarkDotNet?style=social)](https://twitter.com/BenchmarkDotNet)
12+
![License](https://img.shields.io/badge/license-MIT-blue.svg)
13+
[![Twitter](https://img.shields.io/twitter/follow/BenchmarkDotNet?style=social&label=Twitter)](https://twitter.com/BenchmarkDotNet)
1514

16-
</h3>
15+
</div>
1716

18-
<h3 align="center">
17+
<div align="center" style="font-size: 130%; margin-bottom: 20px">
1918
<a href="#features">Features</a>
2019
<span> · </span>
2120
<a href="https://benchmarkdotnet.org/articles/guides/getting-started.html">Getting started</a>
2221
<span> · </span>
2322
<a href="https://benchmarkdotnet.org/articles/overview.html">Documentation</a>
2423
<span> · </span>
2524
<a href="#learn-more-about-benchmarking">Learn more about benchmarking</a>
26-
</h3>
25+
</div>
2726

2827
**BenchmarkDotNet** helps you to transform methods into benchmarks, track their performance, and share reproducible measurement experiments.
2928
It's no harder than writing unit tests!
3029
Under the hood, it performs a lot of [magic](#automation) that guarantees [reliable and precise](#reliability) results thanks to the [perfolizer](https://github.com/AndreyAkinshin/perfolizer) statistical engine.
3130
BenchmarkDotNet protects you from popular benchmarking mistakes and warns you if something is wrong with your benchmark design or obtained measurements.
3231
The results are presented in a [user-friendly](#friendliness) form that highlights all the important facts about your experiment.
33-
The library is adopted by [16500+ GitHub projects](#who-uses-benchmarkdotnet) including .NET Runtime and supported by the [.NET Foundation](https://dotnetfoundation.org).
32+
The library is adopted by [16500+ GitHub projects](#who-uses-benchmarkdotnet) including .NET Runtime.
3433

35-
It's [easy](#simplicity) to start writing benchmarks, check out an example
34+
It's [easy](#simplicity) to start writing benchmarks, check out the following example
3635
(copy-pastable version is [here](https://benchmarkdotnet.org/articles/guides/getting-started.html)):
3736

3837
```cs
@@ -106,7 +105,7 @@ Intel Core i7-7700K CPU 4.20GHz (Kaby Lake), 1 CPU, 8 logical and 4 physical cor
106105

107106
The measured data can be exported to different formats (md, html, csv, xml, json, etc.) including plots:
108107

109-
![](docs/images/v0.12.0/rplot.png)
108+
![](https://raw.githubusercontent.com/dotnet/BenchmarkDotNet/ec962b0bd6854c991d7a3ebd77037579165acb36/docs/images/v0.12.0/rplot.png)
110109

111110
*Supported runtimes:* .NET 5+, .NET Framework 4.6.1+, .NET Core 2.0+, Mono, NativeAOT
112111
*Supported languages:* C#, F#, Visual Basic
@@ -128,7 +127,7 @@ For example, if you want to [parameterize](https://benchmarkdotnet.org/articles/
128127
mark a field or a property with `[Params(1, 2, 3)]`: BenchmarkDotNet will enumerate all of the specified values
129128
and run benchmarks for each case.
130129
If you want to compare benchmarks with each other,
131-
mark one of the benchmark as the [baseline](https://benchmarkdotnet.org/articles/features/baselines.html)
130+
mark one of the benchmarks as the [baseline](https://benchmarkdotnet.org/articles/features/baselines.html)
132131
via `[Benchmark(Baseline = true)]`: BenchmarkDotNet will compare it with all of the other benchmarks.
133132
If you want to compare performance in different environments, use [jobs](https://benchmarkdotnet.org/articles/configs/jobs.html).
134133
For example, you can run all the benchmarks on .NET Core 3.0 and Mono via
@@ -158,12 +157,12 @@ If you prefer command-line experience, you can configure your benchmarks via
158157

159158
Reliable benchmarks always include a lot of boilerplate code.
160159

161-
Let's think about what should you do in a typical case.
160+
Let's think about what you should do in a typical case.
162161
First, you should perform a pilot experiment and determine the best number of method invocations.
163162
Next, you should execute several warm-up iterations and ensure that your benchmark achieved a steady state.
164163
After that, you should execute the main iterations and calculate some basic statistics.
165-
If you calculate some values in your benchmark, you should use it somehow to prevent the dead code elimination.
166-
If you use loops, you should care about an effect of the loop unrolling on your results
164+
If you calculate some values in your benchmark, you should use it somehow to prevent dead code elimination.
165+
If you use loops, you should care about the effect of the loop unrolling on your results
167166
(which may depend on the processor architecture).
168167
Once you get results, you should check for some special properties of the obtained performance distribution
169168
like multimodality or extremely high outliers.
@@ -174,7 +173,7 @@ If you write this code from scratch, it's easy to make a mistake and spoil your
174173
Note that it's a shortened version of the full checklist that you should follow during benchmarking:
175174
there are a lot of additional hidden pitfalls that should be handled appropriately.
176175
Fortunately, you shouldn't worry about it because
177-
BenchmarkDotNet [will do](https://benchmarkdotnet.org/articles/guides/how-it-works.html) this boring and time-consuming stuff for you.
176+
BenchmarkDotNet [will perform](https://benchmarkdotnet.org/articles/guides/how-it-works.html) this boring and time-consuming stuff for you.
178177

179178
Moreover, the library can help you with some advanced tasks that you may want to perform during the investigation.
180179
For example,
@@ -193,10 +192,10 @@ You shouldn't worry about the perfect number of method invocation, the number of
193192
So, you shouldn't use any magic numbers (like "We should perform 100 iterations here"),
194193
the library will do it for you based on the values of statistical metrics.
195194

196-
BenchmarkDotNet also prevents benchmarking of non-optimized assemblies that was built using DEBUG mode because
195+
BenchmarkDotNet also prevents benchmarking of non-optimized assemblies that were built using DEBUG mode because
197196
the corresponding results will be unreliable.
198-
It will print a warning you if you have an attached debugger,
199-
if you use hypervisor (HyperV, VMware, VirtualBox),
197+
The library will print a warning if you have an attached debugger,
198+
if you use a hypervisor (HyperV, VMware, VirtualBox),
200199
or if you have any other problems with the current environment.
201200

202201
During 6+ years of development, we faced dozens of different problems that may spoil your measurements.
@@ -224,7 +223,7 @@ In this case, you can scroll the results up and check out ASCII-style histograms
224223
or generate beautiful png plots using `[RPlotExporter]`.
225224

226225
BenchmarkDotNet doesn't overload you with data; it shows only the essential information depending on your results:
227-
it allows you to keep summary small for primitive cases and extend it only for the complicated cases.
226+
it allows you to keep the summary small for primitive cases and extend it only for complicated cases.
228227
Of course, you can request any additional statistics and visualizations manually.
229228
If you don't customize the summary view,
230229
the default presentation will be as much user-friendly as possible. :)
@@ -270,7 +269,7 @@ BenchmarkDotNet is already adopted by more than [16500+](https://github.com/dotn
270269
## Learn more about benchmarking
271270

272271
BenchmarkDotNet is not a silver bullet that magically makes all of your benchmarks correct and analyzes the measurements for you.
273-
Even if you use this library, you still should know how to design the benchmark experiments and how to make correct conclusions based on the raw data.
272+
Even if you use this library, you still should know how to design benchmark experiments and how to make correct conclusions based on the raw data.
274273
If you want to know more about benchmarking methodology and good practices,
275274
it's recommended to read a book by Andrey Akinshin (the BenchmarkDotNet project lead): ["Pro .NET Benchmarking"](https://aakinshin.net/prodotnetbenchmarking/).
276275
Use this in-depth guide to correctly design benchmarks, measure key performance metrics of .NET applications, and analyze results.
@@ -287,11 +286,11 @@ You will avoid common pitfalls, control the accuracy of your measurements, and i
287286

288287
| Build server | Platform | Build status |
289288
|--------------|----------|--------------|
290-
| Azure Pipelines | Windows | [![Azure Pipelines Windows](https://dev.azure.com/dotnet/BenchmarkDotNet/_apis/build/status/BenchmarkDotNet%20-%20Windows)](https://dev.azure.com/dotnet/BenchmarkDotNet/_build/latest?definitionId=55) |
291-
| Azure Pipelines | Ubuntu | [![Azure Pipelines Ubuntu](https://dev.azure.com/dotnet/BenchmarkDotNet/_apis/build/status/BenchmarkDotNet%20-%20Ubuntu)](https://dev.azure.com/dotnet/BenchmarkDotNet/_build/latest?definitionId=56) |
292-
| Azure Pipelines | macOS | [![Azure Pipelines macOS](https://dev.azure.com/dotnet/BenchmarkDotNet/_apis/build/status/BenchmarkDotNet%20-%20macOS)](https://dev.azure.com/dotnet/BenchmarkDotNet/_build/latest?definitionId=57) |
289+
| Azure Pipelines | Windows | [![Azure Windows](https://dev.azure.com/dotnet/BenchmarkDotNet/_apis/build/status/BenchmarkDotNet%20-%20Windows)](https://dev.azure.com/dotnet/BenchmarkDotNet/_build/latest?definitionId=55) |
290+
| Azure Pipelines | Ubuntu | [![Azure Ubuntu](https://dev.azure.com/dotnet/BenchmarkDotNet/_apis/build/status/BenchmarkDotNet%20-%20Ubuntu)](https://dev.azure.com/dotnet/BenchmarkDotNet/_build/latest?definitionId=56) |
291+
| Azure Pipelines | macOS | [![Azure macOS](https://dev.azure.com/dotnet/BenchmarkDotNet/_apis/build/status/BenchmarkDotNet%20-%20macOS)](https://dev.azure.com/dotnet/BenchmarkDotNet/_build/latest?definitionId=57) |
293292
| AppVeyor | Windows | [![AppVeyor/Windows](https://img.shields.io/appveyor/ci/dotnetfoundation/benchmarkdotnet/master.svg)](https://ci.appveyor.com/project/dotnetfoundation/benchmarkdotnet/branch/master) |
294-
| GitHub Actions | * | [![build](https://github.com/dotnet/BenchmarkDotNet/actions/workflows/build.yaml/badge.svg)](https://github.com/dotnet/BenchmarkDotNet/actions/workflows/build.yaml) |
293+
| GitHub Actions | * | [![GitHub Actions](https://github.com/dotnet/BenchmarkDotNet/actions/workflows/build.yaml/badge.svg)](https://github.com/dotnet/BenchmarkDotNet/actions/workflows/build.yaml) |
295294

296295
## Contributions are welcome!
297296

@@ -309,6 +308,6 @@ Let's build the best tool for benchmarking together!
309308

310309
## Code of Conduct
311310

312-
This project has adopted the code of conduct defined by the [Contributor Covenant](http://contributor-covenant.org/)
311+
This project has adopted the code of conduct defined by the [Contributor Covenant](https://www.contributor-covenant.org/)
313312
to clarify expected behavior in our community.
314313
For more information, see the [.NET Foundation Code of Conduct](https://dotnetfoundation.org/code-of-conduct).

build/Program.cs

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ public void EnsureChangelogDetailsExist(bool forceClean = false)
162162
var path = ChangeLogGenDirectory.Combine("details");
163163
if (this.DirectoryExists(path) && forceClean)
164164
this.DeleteDirectory(path, new DeleteDirectorySettings() { Force = true, Recursive = true });
165-
165+
166166
if (!this.DirectoryExists(path))
167167
{
168168
var settings = new GitCloneSettings { Checkout = true, BranchName = "docs-changelog-details" };
@@ -475,7 +475,7 @@ public override void Run(BuildContext context)
475475
{
476476
var count = context.Argument("VersionCount", -1);
477477
var total = DocumentationHelper.BdnAllVersions.Length;
478-
478+
479479
if (count == 0)
480480
{
481481
context.DocfxChangelogDownload(
@@ -569,6 +569,14 @@ public class DocfxBuildTask : FrostingTask<BuildContext>
569569
{
570570
public override void Run(BuildContext context)
571571
{
572+
context.Information("DocfxBuild: Generate index.md");
573+
var content = new StringBuilder();
574+
content.AppendLine("---");
575+
content.AppendLine("title: Home");
576+
content.AppendLine("---");
577+
content.Append(context.FileReadText(context.RootDirectory.CombineWithFilePath("README.md")));
578+
context.FileWriteText(context.DocsDirectory.CombineWithFilePath("index.md"), content.ToString());
579+
572580
context.RunDocfx(context.DocfxJsonFile);
573581
context.GenerateRedirects();
574582
}
@@ -636,8 +644,7 @@ public override void Run(BuildContext context)
636644
};
637645
var files = new[]
638646
{
639-
context.RootDirectory.CombineWithFilePath("README.md"),
640-
context.DocsDirectory.CombineWithFilePath("index.md")
647+
context.RootDirectory.CombineWithFilePath("README.md")
641648
};
642649
foreach (var file in files)
643650
{
@@ -648,7 +655,7 @@ public override void Run(BuildContext context)
648655
lines[i] = updater.Apply(lines[i]);
649656
}
650657

651-
context.FileWriteLines(file, lines);
658+
context.FileWriteLines(file, lines);
652659
}
653660
}
654-
}
661+
}

docs/.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ _site
1010
_exported_templates
1111
docfx-bin
1212
api/*
13-
!api/index.md
13+
!api/index.md
14+
/index.md

0 commit comments

Comments
 (0)