Exploring .NET Math Libraries: An Introduction to the NMLs Research Project
Victor Sanchez
Posted on August 19, 2024
Welcome to our exploration of .NET math libraries! In this blog post, we’ll dive into the NMLs (Math Libraries) research project—a solution built using .NET Core 8.0.X designed to evaluate and benchmark various math libraries.
Whether you're a developer interested in mathematical computations or a performance enthusiast, this project offers valuable insights into the capabilities and performance of different libraries.
You could find the code in this repository
Overview
The NMLs solution aims to provide a robust environment for exploring and benchmarking various .NET math libraries. Built on .NET Core 8.0.X, it facilitates the execution and evaluation of mathematical expressions while offering tools to compare performance across different libraries. Here’s a look at what the project entails:
Solution Structure
The Visual Studio solution for NMLs is organized into three main projects, each serving a specific purpose:
-
MathLibsLogic
Purpose: This project contains implementations for various math libraries.- Each library is encapsulated in a class named My[LibraryName], allowing for easy extension and customization.
- Manages all NuGet package dependencies necessary for the math libraries, ensuring that all components are up-to-date and properly configured.
-
NMLs
Purpose: A console application that allows users to test mathematical expressions and library implementations.- Users can input mathematical expressions and select different library implementations to test.
- Utilizes a loop with a property flag to keep the application running, accepting input until the user decides to exit.
-
Benchmarking
Purpose: To compare the performance of different math libraries.- Uses the BenchmarkDotNet package to provide detailed performance metrics.
- Allows for updating and running benchmark tests with various mathematical expressions to evaluate and compare library performance.
External Projects
Our research includes evaluating the following external projects:
ExpressionEvaluator 1.4.40
A versatile library for evaluating expressions. Explore it here.
ExpresiveParser 3.0.1
A powerful parser for evaluating expressions. Check out the project here.
Microsoft.ClearScript 7.4.5
A library for integrating and executing scripts in .NET applications. Learn more here.
How to Run
Using Visual Studio
- Open the NMLs solution in Visual Studio.
- In the Solution Explorer, right-click on either the Benchmarking or NMLs project.
- Select "Set as Startup Project".
- Press F5 *or click the *"Start" button to run the project.
Using Terminal
Navigate to the root directory of the cloned repository.
Build the projects with:
dotnet build ./NMLs/NMLs.csproj
dotnet build ./Benchmarking/Benchmarking.csproj
Run the desired project with:
dotnet run --project ./NMLs/NMLs.csproj
or
dotnet build --configuration Release
dotnet run --project ./Benchmarking/Benchmarking.csproj --configuration Release
Keep in mind that BenckmarkingDotNet needs to us the build project using Release configuration.
Contribution
We welcome contributions to this project! If you have suggestions, improvements, or find any issues, feel free to submit issues or pull requests. Your contributions help enhance the project and benefit the community.
Posted on August 19, 2024
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.