arepetti / netmicrobenchmark Goto Github PK
View Code? Open in Web Editor NEWA small tool to perform microbenchmarks for .NET code.
License: MIT License
A small tool to perform microbenchmarks for .NET code.
License: MIT License
Advanced statistical analysis may be performed with Microsoft Excel. This OutputRenderer
should not use Statistics
but simply dump all measures in Benchmark
into a spreadsheet document.
Better statistical analysis (especially if using a huge number of measures) may detect aleatory performance in some algorithms (for example because of dependencies on unstable resources like I/O or network connection) like this:
public class Benchmark {
public void DownloadAllFiles() {
foreach (var fileToDownload in GetFilesToDownload()) {
DownloadFileWithHttp(fileToDownload.LocalPath, fileToDownload.ServerUrl);
}
}
public void DownloadAllFiles() {
Parallel.ForEach(GetFilesToDownload(), fileToDownload => {
DownloadFileWithHttp(fileToDownload.LocalPath, fileToDownload.ServerUrl);
});
}
// ...
}
Note that highly dispersed measures may also be caused by wrong benchmark setup...
Benchmarks may be performed directly inside Visual Studio (searching for classes by convention or popping up a dialog where user can select which classes he wants to benchmark). Add-in should be available with nuget.
Currently to execute a benchmark you need Visual Studio (where you write and compile code). A small utility where you can write benchmark code (without Intellisense but with syntax highlighter) and run/view test results may be useful.
Same utility may also benchmark a set of given already compiled assemblies eventually selecting specific methods to test. It may work also simply generating benchmark code to invoke those methods - if public - because for this kind of tests we.assume that function call overhead is almost negligible.
Command line support would also be a nice feature (for example as a simple msbuild support).
Current implementation is for VS2k12 however some desiderable features are available in VS2k15, when codebase is stable (to have a reliable version compatible with older compilers) will be available then this minor porting should be done.
Currently the only output render is HtmlOutputRenderer
which renders to HTML files. Sometimes a simple text file is enough (possibly to be used directly as output in console applications).
Note that this renderer is needed (and a simple plain text template cannot be used) because HtmlOutputRenderer
also performs HTML escaping (which we don't want in plain text files).
Note that this is not true (and this issue may be closed) if we switch to Razor as template engine (instead of Mustache).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.