Skip to content

Commit

Permalink
Add docs for github pages and update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
mjebrahimi committed Jan 19, 2024
1 parent b50d5b3 commit 56a7e89
Show file tree
Hide file tree
Showing 11 changed files with 1,466 additions and 240 deletions.
231 changes: 0 additions & 231 deletions README.html

This file was deleted.

21 changes: 12 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
[![NuGet](https://buildstats.info/nuget/BenchmarkDotNetVisualizer)](https://www.nuget.org/packages/BenchmarkDotNetVisualizer)
[![License: MIT](https://img.shields.io/badge/License-MIT-brightgreen.svg)](https://opensource.org/licenses/MIT)
[![Build Status](https://github.com/mjebrahimi/BenchmarkDotNetVisualizer/workflows/.NET/badge.svg)](https://github.com/mjebrahimi/BenchmarkDotNetVisualizer)

# BenchmarkDotNetVisualizer

Visualizes your BenchmarkDotNet benchmarks to colorful images, feature-rich HTML, and customizable markdown files (and maybe powerful charts in the future!)

**You can create something like this 👇**

![for, foreach, ForEach() Benchmark](https://github.com/mjebrahimi/BenchmarkDotNetVisualizer/blob/master/Demo.png)
![for, foreach, ForEach() Benchmark](https://raw.githubusercontent.com/mjebrahimi/BenchmarkDotNetVisualizer/master/Demo.png)

## Table of Content

Expand Down Expand Up @@ -93,10 +96,10 @@ await summary.SaveAsHtmlAndImageAsync(
```

**Output HTML:**
Visit [HTML file](https://github.com/mjebrahimi/BenchmarkDotNetVisualizer/blob/master/samples/Reports/JsonSerializers/Benchmark.html) in `samples/Reports/JsonSerializers/Benchmark.html`
Visit [HTML file](https://mjebrahimi.github.io/BenchmarkDotNetVisualizer/json-serializers-benchmark.html) in `samples/Reports/JsonSerializers/Benchmark.html`

**Output Image:**
![Json Serializers Benchmark](https://github.com/mjebrahimi/BenchmarkDotNetVisualizer/blob/master/samples/Reports/JsonSerializers/Benchmark.png)
![Json Serializers Benchmark](https://raw.githubusercontent.com/mjebrahimi/BenchmarkDotNetVisualizer/master/samples/Reports/JsonSerializers/Benchmark.png)

#### Example 2 (Iterators for/foreach/ForEach() Benchmark)

Expand Down Expand Up @@ -130,10 +133,10 @@ await summary.SaveAsHtmlAndImageAsync(
```

**Output HTML:**
Visit [HTML file](https://github.com/mjebrahimi/BenchmarkDotNetVisualizer/blob/master/samples/Reports/Iterators/Benchmark.html) in `samples/Reports/Iterators/Benchmark.html`
Visit [HTML file](https://mjebrahimi.github.io/BenchmarkDotNetVisualizer/iterators-benchmark1.html) in `samples/Reports/Iterators/Benchmark.html`

**Output Image:**
![Iterators Benchmark](https://github.com/mjebrahimi/BenchmarkDotNetVisualizer/blob/master/samples/Reports/Iterators/Benchmark.png)
![Iterators Benchmark](https://raw.githubusercontent.com/mjebrahimi/BenchmarkDotNetVisualizer/master/samples/Reports/Iterators/Benchmark.png)

### 4. Using JoinReports method to Join and Pivot reports

Expand Down Expand Up @@ -167,10 +170,10 @@ await summary.JoinReportsAndSaveAsHtmlAndImageAsync(
```

**Output HTML:**
Visit [HTML file](https://github.com/mjebrahimi/BenchmarkDotNetVisualizer/blob/master/samples/Reports/Iterators/JoinedBenchmark-PivotBy-Runtime.html) in `samples/Reports/Iterators/JoinedBenchmark-PivotBy-Runtime.html`
Visit [HTML file](https://mjebrahimi.github.io/BenchmarkDotNetVisualizer/iterators-benchmark2.html) in `samples/Reports/Iterators/JoinedBenchmark-PivotBy-Runtime.html`

**Output Image:**
![Iterators Benchmark](https://github.com/mjebrahimi/BenchmarkDotNetVisualizer/blob/master/samples/Reports/Iterators/JoinedBenchmark-PivotBy-Runtime.png)
![Iterators Benchmark](https://raw.githubusercontent.com/mjebrahimi/BenchmarkDotNetVisualizer/master/samples/Reports/Iterators/JoinedBenchmark-PivotBy-Runtime.png)

#### Example 4 (Performance comparison between for, foreach, and ForEach() in different versions of .NET)

Expand Down Expand Up @@ -202,10 +205,10 @@ await summary2.JoinReportsAndSaveAsHtmlAndImageAsync(
```

**Output HTML:**
Visit [HTML file](https://github.com/mjebrahimi/BenchmarkDotNetVisualizer/blob/master/samples/Reports/Iterators/JoinedBenchmark-PivotBy-Method.html) in `samples/Reports/Iterators/JoinedBenchmark-PivotBy-Method.html`
Visit [HTML file](https://mjebrahimi.github.io/BenchmarkDotNetVisualizer/iterators-benchmark3.html) in `samples/Reports/Iterators/JoinedBenchmark-PivotBy-Method.html`

**Output Image:**
![Iterators Benchmark](https://github.com/mjebrahimi/BenchmarkDotNetVisualizer/blob/master/samples/Reports/Iterators/JoinedBenchmark-PivotBy-Method.png)
![Iterators Benchmark](https://raw.githubusercontent.com/mjebrahimi/BenchmarkDotNetVisualizer/master/samples/Reports/Iterators/JoinedBenchmark-PivotBy-Method.png)

## Todo

Expand Down
7 changes: 7 additions & 0 deletions docs/assets/bootstrap.min.css

Large diffs are not rendered by default.

67 changes: 67 additions & 0 deletions docs/assets/cshtml-razor.min.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
hljs.registerLanguage("cshtml-razor",(()=>{"use strict";return n=>{
var e="built_in",s={},a={begin:"}",className:e,endsParent:!0},i={begin:"{",
end:"}",contains:[n.QUOTE_STRING_MODE,"self"]},r=n.COMMENT("@\\*","\\*@",{
relevance:10}),g={begin:"@[A-Za-z0-9\\._:-]+",returnBegin:!0,
end:"(\\r|\\n|<|\\s|\"|')",subLanguage:"csharp",contains:[{begin:"@",className:e
},{begin:"\\[",end:"\\]",skip:!0},{begin:"\\(",end:"\\)",skip:!0}],returnEnd:!0
},t={begin:"[@]{0,1}<text>",returnBegin:!0,end:"</text>",returnEnd:!0,
subLanguage:"cshtml-razor",contains:[{begin:"[@]{0,1}<text>",className:e},{
begin:"</text>",className:e,endsParent:!0}]},c={begin:"@\\(",end:"\\)",
returnBegin:!0,returnEnd:!0,subLanguage:"csharp",contains:[{begin:"@\\(",
className:e},{begin:"\\(",end:"\\)",subLanguage:"csharp",
contains:[n.QUOTE_STRING_MODE,"self",t]},t,{begin:"\\)",className:e,
endsParent:!0}]},b=((n,e)=>{var s={endsWithParent:!0,illegal:/</,relevance:0,
contains:[{className:"attr",begin:"[A-Za-z0-9\\._:-]+",relevance:0},{
begin:/=\s*/,relevance:0,contains:[{className:"string",variants:[{begin:/"/,
end:/"/,contains:e},{begin:/'/,end:/'/,contains:e},{begin:/[^\s"'=<>`]+/}]}]}]}
;return[{className:"meta",begin:"<!DOCTYPE",end:">",relevance:10,contains:[{
begin:"\\[",end:"\\]"}]},n.COMMENT("\x3c!--","--\x3e",{relevance:10}),{
begin:"<\\!\\[CDATA\\[",end:"\\]\\]>",relevance:10},{className:"meta",
begin:/<\?xml/,end:/\?>/,relevance:10},{className:"tag",
begin:"<style(?=\\s|>|$)",end:">",keywords:{name:"style"},contains:[s],starts:{
end:"</style>",returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",
begin:"<script(?=\\s|>|$)",end:">",keywords:{name:"script"},contains:[s],
starts:{end:"<\/script>",returnEnd:!0,
subLanguage:["actionscript","javascript","handlebars","xml"]}},{className:"tag",
begin:"</?",end:"/?>",contains:[{className:"name",begin:/[^\/><\s]+/,relevance:0
},s]}].concat(e)
})(n,[g,c]),l="^\\s*@(page|model|using|inherits|inject|layout)",u={
begin:l+"[^\\r\\n{\\(]*$",end:"$",returnBegin:!0,returnEnd:!0,contains:[{
begin:l,className:e},{variants:[{begin:"\\r|\\n",endsParent:!0},{
begin:"\\s[^\\r\\n]+",end:"$"},{begin:"$"}],className:"type",endsParent:!0}]
},d={variants:[{begin:"@\\{",end:"}"},{begin:"@code\\s*\\{",end:"}"}],
returnBegin:!0,returnEnd:!0,subLanguage:"csharp",contains:[{
begin:"@(code\\s*)?\\{",className:e},s,{begin:"{",end:"}",contains:["self"],
skip:!0},a]},o={begin:"^\\s*@helper[\\s]*[^{]+[\\s]*{",returnBegin:!0,
returnEnd:!0,end:"}",subLanguage:"cshtml-razor",contains:[{begin:"@helper",
className:e},{begin:"{",className:e},a]},m=[{begin:"@for[\\s]*\\([^{]+[\\s]*{",
end:"}"},{begin:"@if[\\s]*\\([^{]+[\\s]*{",end:"}"},{
begin:"@switch[\\s]*\\([^{]+[\\s]*{",end:"}"},{
begin:"@while[\\s]*\\([^{]+[\\s]*{",end:"}"},{
begin:"@using[\\s]*\\([^{]+[\\s]*{",end:"}"},{
begin:"@lock[\\s]*\\([^{]+[\\s]*{",end:"}"},{
begin:"@foreach[\\s]*\\([^{]+[\\s]*{",end:"}"}],N={variants:m,returnBegin:!0,
returnEnd:!0,subLanguage:"csharp",contains:[{variants:m.map((n=>({begin:n.begin
}))),returnBegin:!0,contains:[{begin:"@",className:e},{variants:m.map((n=>({
begin:n.begin.substr(1,n.begin.length-2)}))),subLanguage:"csharp"},{begin:"{",
className:e}]},s,{variants:[{begin:"}[\\s]*else\\sif[\\s]*\\([^{]+[\\s]*{"},{
begin:"}[\\s]*else[\\s]*{"}],returnBegin:!0,contains:[{begin:"}",className:e},{
variants:[{begin:"[\\s]*else\\sif[\\s]*\\([^{]+[\\s]*{"},{
begin:"[\\s]*else[\\s]*"}],subLanguage:"csharp"},{begin:"{",className:e}]},i,a]
},h={begin:"@try[\\s]*{",end:"}",returnBegin:!0,returnEnd:!0,
subLanguage:"csharp",contains:[{begin:"@",className:e},{begin:"try[\\s]*{",
subLanguage:"csharp"},{variants:[{begin:"}[\\s]*catch[\\s]*\\([^\\)]+\\)[\\s]*{"
},{begin:"}[\\s]*finally[\\s]*{"}],returnBegin:!0,contains:[{begin:"}",
className:e},{variants:[{begin:"[\\s]*catch[\\s]*\\([^\\)]+\\)[\\s]*"},{
begin:"[\\s]*finally[\\s]*"}],subLanguage:"csharp"},{begin:"{",className:e}]
},s,i,a]},p="@section[\\s]+[a-zA-Z0-9]+[\\s]*{",v=[u,o,d,N,{begin:p,
returnBegin:!0,returnEnd:!0,end:"}",subLanguage:"cshtml-razor",contains:[{
begin:p,className:e},i,a]},{begin:"@await ",returnBegin:!0,subLanguage:"csharp",
end:"(\\r|\\n|<|\\s)",contains:[{begin:"@await ",className:e},{
begin:"[<\\r\\n]",endsParent:!0}]},h,{variants:[{begin:"@@"},{begin:"[a-zA-Z]+@"
}],skip:!0},t,r,c,{className:"meta",begin:"<!DOCTYPE",end:">",relevance:10,
contains:[{begin:"\\[",end:"\\]"}]},{begin:"<\\!\\[CDATA\\[",end:"\\]\\]>",
relevance:10}].concat(b);return[d,N,h].forEach((n=>{
var e=v.filter((e=>e!==n)),a=n.contains.indexOf(s)
;n.contains.splice.apply(n.contains,[a,1].concat(e))})),{
aliases:["cshtml","razor","razor-cshtml","cshtml-razor"],contains:v}}})());
76 changes: 76 additions & 0 deletions docs/assets/site.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
/* Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification
for details on configuring this project to bundle and minify static web assets. */

a.navbar-brand {
white-space: normal;
text-align: center;
word-break: break-all;
}

/* Provide sufficient contrast against white background */
a {
color: #0366d6;
}

.btn-primary {
color: #fff;
background-color: #1b6ec2;
border-color: #1861ac;
}

.nav-pills .nav-link.active, .nav-pills .show > .nav-link {
color: #fff;
background-color: #1b6ec2;
border-color: #1861ac;
}

/* Sticky footer styles
-------------------------------------------------- */
html {
font-size: 14px;
}
@media (min-width: 768px) {
html {
font-size: 16px;
}
}

.border-top {
border-top: 1px solid #e5e5e5;
}
.border-bottom {
border-bottom: 1px solid #e5e5e5;
}

.box-shadow {
box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05);
}

button.accept-policy {
font-size: 1rem;
line-height: inherit;
}

/* Sticky footer styles
-------------------------------------------------- */
html {
position: relative;
min-height: 100%;
}

body {
/* Margin bottom by footer height */
margin-bottom: 60px;
}
.footer {
position: absolute;
bottom: 0;
width: 100%;
white-space: nowrap;
line-height: 60px; /* Vertically center the text there */
}

code{
background-color: whitesmoke !important;
padding: 3px;
}
67 changes: 67 additions & 0 deletions docs/cshtml-razor.min.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
hljs.registerLanguage("cshtml-razor",(()=>{"use strict";return n=>{
var e="built_in",s={},a={begin:"}",className:e,endsParent:!0},i={begin:"{",
end:"}",contains:[n.QUOTE_STRING_MODE,"self"]},r=n.COMMENT("@\\*","\\*@",{
relevance:10}),g={begin:"@[A-Za-z0-9\\._:-]+",returnBegin:!0,
end:"(\\r|\\n|<|\\s|\"|')",subLanguage:"csharp",contains:[{begin:"@",className:e
},{begin:"\\[",end:"\\]",skip:!0},{begin:"\\(",end:"\\)",skip:!0}],returnEnd:!0
},t={begin:"[@]{0,1}<text>",returnBegin:!0,end:"</text>",returnEnd:!0,
subLanguage:"cshtml-razor",contains:[{begin:"[@]{0,1}<text>",className:e},{
begin:"</text>",className:e,endsParent:!0}]},c={begin:"@\\(",end:"\\)",
returnBegin:!0,returnEnd:!0,subLanguage:"csharp",contains:[{begin:"@\\(",
className:e},{begin:"\\(",end:"\\)",subLanguage:"csharp",
contains:[n.QUOTE_STRING_MODE,"self",t]},t,{begin:"\\)",className:e,
endsParent:!0}]},b=((n,e)=>{var s={endsWithParent:!0,illegal:/</,relevance:0,
contains:[{className:"attr",begin:"[A-Za-z0-9\\._:-]+",relevance:0},{
begin:/=\s*/,relevance:0,contains:[{className:"string",variants:[{begin:/"/,
end:/"/,contains:e},{begin:/'/,end:/'/,contains:e},{begin:/[^\s"'=<>`]+/}]}]}]}
;return[{className:"meta",begin:"<!DOCTYPE",end:">",relevance:10,contains:[{
begin:"\\[",end:"\\]"}]},n.COMMENT("\x3c!--","--\x3e",{relevance:10}),{
begin:"<\\!\\[CDATA\\[",end:"\\]\\]>",relevance:10},{className:"meta",
begin:/<\?xml/,end:/\?>/,relevance:10},{className:"tag",
begin:"<style(?=\\s|>|$)",end:">",keywords:{name:"style"},contains:[s],starts:{
end:"</style>",returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",
begin:"<script(?=\\s|>|$)",end:">",keywords:{name:"script"},contains:[s],
starts:{end:"<\/script>",returnEnd:!0,
subLanguage:["actionscript","javascript","handlebars","xml"]}},{className:"tag",
begin:"</?",end:"/?>",contains:[{className:"name",begin:/[^\/><\s]+/,relevance:0
},s]}].concat(e)
})(n,[g,c]),l="^\\s*@(page|model|using|inherits|inject|layout)",u={
begin:l+"[^\\r\\n{\\(]*$",end:"$",returnBegin:!0,returnEnd:!0,contains:[{
begin:l,className:e},{variants:[{begin:"\\r|\\n",endsParent:!0},{
begin:"\\s[^\\r\\n]+",end:"$"},{begin:"$"}],className:"type",endsParent:!0}]
},d={variants:[{begin:"@\\{",end:"}"},{begin:"@code\\s*\\{",end:"}"}],
returnBegin:!0,returnEnd:!0,subLanguage:"csharp",contains:[{
begin:"@(code\\s*)?\\{",className:e},s,{begin:"{",end:"}",contains:["self"],
skip:!0},a]},o={begin:"^\\s*@helper[\\s]*[^{]+[\\s]*{",returnBegin:!0,
returnEnd:!0,end:"}",subLanguage:"cshtml-razor",contains:[{begin:"@helper",
className:e},{begin:"{",className:e},a]},m=[{begin:"@for[\\s]*\\([^{]+[\\s]*{",
end:"}"},{begin:"@if[\\s]*\\([^{]+[\\s]*{",end:"}"},{
begin:"@switch[\\s]*\\([^{]+[\\s]*{",end:"}"},{
begin:"@while[\\s]*\\([^{]+[\\s]*{",end:"}"},{
begin:"@using[\\s]*\\([^{]+[\\s]*{",end:"}"},{
begin:"@lock[\\s]*\\([^{]+[\\s]*{",end:"}"},{
begin:"@foreach[\\s]*\\([^{]+[\\s]*{",end:"}"}],N={variants:m,returnBegin:!0,
returnEnd:!0,subLanguage:"csharp",contains:[{variants:m.map((n=>({begin:n.begin
}))),returnBegin:!0,contains:[{begin:"@",className:e},{variants:m.map((n=>({
begin:n.begin.substr(1,n.begin.length-2)}))),subLanguage:"csharp"},{begin:"{",
className:e}]},s,{variants:[{begin:"}[\\s]*else\\sif[\\s]*\\([^{]+[\\s]*{"},{
begin:"}[\\s]*else[\\s]*{"}],returnBegin:!0,contains:[{begin:"}",className:e},{
variants:[{begin:"[\\s]*else\\sif[\\s]*\\([^{]+[\\s]*{"},{
begin:"[\\s]*else[\\s]*"}],subLanguage:"csharp"},{begin:"{",className:e}]},i,a]
},h={begin:"@try[\\s]*{",end:"}",returnBegin:!0,returnEnd:!0,
subLanguage:"csharp",contains:[{begin:"@",className:e},{begin:"try[\\s]*{",
subLanguage:"csharp"},{variants:[{begin:"}[\\s]*catch[\\s]*\\([^\\)]+\\)[\\s]*{"
},{begin:"}[\\s]*finally[\\s]*{"}],returnBegin:!0,contains:[{begin:"}",
className:e},{variants:[{begin:"[\\s]*catch[\\s]*\\([^\\)]+\\)[\\s]*"},{
begin:"[\\s]*finally[\\s]*"}],subLanguage:"csharp"},{begin:"{",className:e}]
},s,i,a]},p="@section[\\s]+[a-zA-Z0-9]+[\\s]*{",v=[u,o,d,N,{begin:p,
returnBegin:!0,returnEnd:!0,end:"}",subLanguage:"cshtml-razor",contains:[{
begin:p,className:e},i,a]},{begin:"@await ",returnBegin:!0,subLanguage:"csharp",
end:"(\\r|\\n|<|\\s)",contains:[{begin:"@await ",className:e},{
begin:"[<\\r\\n]",endsParent:!0}]},h,{variants:[{begin:"@@"},{begin:"[a-zA-Z]+@"
}],skip:!0},t,r,c,{className:"meta",begin:"<!DOCTYPE",end:">",relevance:10,
contains:[{begin:"\\[",end:"\\]"}]},{begin:"<\\!\\[CDATA\\[",end:"\\]\\]>",
relevance:10}].concat(b);return[d,N,h].forEach((n=>{
var e=v.filter((e=>e!==n)),a=n.contains.indexOf(s)
;n.contains.splice.apply(n.contains,[a,1].concat(e))})),{
aliases:["cshtml","razor","razor-cshtml","cshtml-razor"],contains:v}}})());
Loading

0 comments on commit 56a7e89

Please sign in to comment.