This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using FluentValidation; | |
using FluentValidation.Results; | |
using Microsoft.AspNetCore.Builder; | |
using Microsoft.AspNetCore.Hosting; | |
using Microsoft.AspNetCore.Http; | |
using Microsoft.AspNetCore.Mvc; | |
using Microsoft.Extensions.DependencyInjection; | |
using Microsoft.Extensions.Hosting; | |
using SoapCore; | |
using SoapCore.Extensibility; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
My results | |
| Method | Mean | Error | StdDev | | |
|-------------- |-------------:|-----------:|-----------:| | |
| ReturnValue | 61.06 ns | 1.304 ns | 1.281 ns | | |
| ExceptionPath | 31,077.00 ns | 371.773 ns | 347.757 ns | | |
*/ | |
public class FormulaExceptionVsReturnBenchmark : IDisposable | |
{ | |
private readonly IXLWorkbook _workbook; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ReturnValueVsException | |
{ | |
private readonly int _depth; | |
private readonly int _result; | |
public ReturnValueVsException(int depth = 1, int result = -1) | |
{ | |
_depth = depth; | |
_result = result; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
| Method | Mean | Error | StdDev | | |
|-------------- |-------------:|-----------:|-----------:| | |
| ReturnValue | 42.18 ns | 0.736 ns | 0.689 ns | | |
| ExceptionPath | 24,777.17 ns | 199.816 ns | 177.131 ns | | |
*/ | |
public class FormulaExceptionVsReturnBenchmark | |
{ | |
private string formExc = "=ABS(-1)/ABS(0)"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using BenchmarkDotNet.Attributes; | |
using BenchmarkDotNet.Running; | |
using ClosedXML.Excel; | |
namespace ClosedXML.Sandbox | |
{ | |
[RPlotExporter] | |
public class FormulaBenchmark | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ce.RegisterFunction("SUM", 1, int.MaxValue, Sum, FunctionFlags.Range, AllowRange.All); | |
private static AnyValue Sum(CalcContext ctx, Span<AnyValue?> args) | |
{ | |
var sum = 0.0; | |
foreach (var nullableArg in args) | |
{ | |
if (!nullableArg.HasValue) | |
continue; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections.Generic; | |
using BenchmarkDotNet.Attributes; | |
using BenchmarkDotNet.Running; | |
using ClosedXML.Excel; | |
using NUnit.Framework; | |
namespace ClosedXML.Sandbox | |
{ | |
[TestFixture] | |
[RPlotExporter] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void Main() | |
{ | |
var workbook = new XLWorkbook(); | |
var worksheet = workbook.Worksheets.Add("Dati"); | |
DataGenerationWithBigData(worksheet); | |
worksheet.Columns().AdjustToContents(); | |
worksheet.PageSetup.PageOrientation = XLPageOrientation.Portrait; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DataTable dt = new DataTable(); | |
DataColumn dc1 = new DataColumn("A", typeof(String)); | |
DataColumn dc2 = new DataColumn("B", typeof(String)); | |
DataColumn dc3 = new DataColumn("C", typeof(String)); | |
DataColumn dc4 = new DataColumn("D", typeof(String)); | |
DataColumn dc5 = new DataColumn("E", typeof(String)); | |
DataColumn dc6 = new DataColumn("F", typeof(String)); | |
DataColumn dc7 = new DataColumn("G", typeof(String)); | |
DataColumn dc8 = new DataColumn("H", typeof(String)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Data; | |
using System.Diagnostics; | |
using System.IO; | |
using System.Linq; | |
using ClosedXML.Excel; | |
namespace ClosedXML.Sandbox | |
{ |
OlderNewer