DEV Community

Victor Sanchez
Victor Sanchez

Posted on

Exploring .NET Math Libraries: An Introduction to the NMLs Research Project

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

Application Directory

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:

  1. 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.
  2. 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.
  3. 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

  1. Open the NMLs solution in Visual Studio.
  2. In the Solution Explorer, right-click on either the Benchmarking or NMLs project.
  3. Select "Set as Startup Project".
  4. 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
Enter fullscreen mode Exit fullscreen mode

Run the desired project with:

dotnet run --project ./NMLs/NMLs.csproj
Enter fullscreen mode Exit fullscreen mode

Console App Running

or

dotnet build --configuration Release
dotnet run --project ./Benchmarking/Benchmarking.csproj --configuration Release
Enter fullscreen mode Exit fullscreen mode

Keep in mind that BenckmarkingDotNet needs to us the build project using Release configuration.

BenchmarkDotNet Results


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.

Heroku

This site is built on Heroku

Join the ranks of developers at Salesforce, Airbase, DEV, and more who deploy their mission critical applications on Heroku. Sign up today and launch your first app!

Get Started

Top comments (0)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →

👋 Kindness is contagious

Explore a sea of insights with this enlightening post, highly esteemed within the nurturing DEV Community. Coders of all stripes are invited to participate and contribute to our shared knowledge.

Expressing gratitude with a simple "thank you" can make a big impact. Leave your thanks in the comments!

On DEV, exchanging ideas smooths our way and strengthens our community bonds. Found this useful? A quick note of thanks to the author can mean a lot.

Okay