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
[MemoryDiagnoser(false)] | |
public class AverageBenchmark : IDisposable | |
{ | |
private readonly XLWorkbook _wb; | |
private readonly IXLWorksheet _ws; | |
[Params(1000, 10000, 100000)] | |
public int RowsCount; | |
public AverageBenchmark() |
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 SumProductBenchmark : IDisposable | |
{ | |
private readonly XLWorkbook _wb; | |
private readonly IXLWorksheet _ws; | |
[Params(1000, 10000, 100000)] | |
public int RowsCount; | |
public SumProductBenchmark() | |
{ |
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
var sw = Stopwatch.StartNew(); | |
using var wb = new XLWorkbook(); | |
var sheet = wb.AddWorksheet(); | |
// Lazy created data | |
var data = Enumerable.Range(0, 1_000_000).Select(_ => | |
{ | |
return Enumerable.Range(0, 10).Select(_ => "Hello world"); | |
}); |
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
var sw = Stopwatch.StartNew(); | |
using var wb = new XLWorkbook(); | |
var sheet = wb.AddWorksheet(); | |
// Lazy created data | |
var data = Enumerable.Range(0, 250_000).Select(_ => | |
{ | |
// Always create new string, like database provider would | |
var text = Enumerable.Range(0, 10).Select<int, object>(_ => new string("Hello world")); | |
var numbers = Enumerable.Range(0, 5).Cast<object>(); |
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.Text; | |
using Antlr4.Runtime; | |
internal class Program | |
{ | |
private static void Main(string[] args) | |
{ | |
Console.WriteLine("Hello, World!"); | |
var f = string.Join("\n", File.ReadAllLines(@"c:\Users\havli\source\repos\Antlr2Rolex\FormulaLexer.g4")); | |
var inputStream = new AntlrInputStream(f); |
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
REF_CONSTANT = '((#REF!))' | |
NONREF_ERRORS = '((#DIV/0!)|(#N/A)|(#NAME\?)|(#NULL!)|(#NUM!)|(#VALUE!)|(#GETTING_DATA))' | |
LOGICAL_CONSTANT = '((FALSE)|(TRUE))' | |
NUMERICAL_CONSTANT = '((((((((((((((([0-9]))))))+)))))(((((((((\.))((((((((([0-9]))))))+)))))))))?))|(((((\.))((((((((([0-9]))))))+)))))))((((((E))(((((((\+)|(\-))))))?)((((((((([0-9]))))))+))))))?)))' | |
STRING_CONSTANT = '(((("))((((((((((("")))|(((\u0009)|(\u000A)|(\u000D)|([\u0020-\u0021])|([\u0023-\uD7FF])|([\uE000-\uFFFD])|([\u10000-\u10FFFF])))))))(((((((((((("")))|(((\u0009)|(\u000A)|(\u000D)|([\u0020-\u0021])|([\u0023-\uD7FF])|([\uE000-\uFFFD])|([\u10000-\u10FFFF])))))))))))*))))?)(("))))' | |
POW = '((((((((( )|(\u000D)|(\u000A))))*)))\^((((((( )|(\u000D)|(\u000A))))*)))))' | |
MULT = '((((((((( )|(\u000D)|(\u000A))))*)))\*((((((( )|(\u000D)|(\u000A))))*)))))' | |
DIV = '((((((((( )|(\u000D)|(\u000A))))*)))/((((((( )|(\u000D)|(\u000A))))*)))))' | |
PLUS = '((((((((( )|(\u000D)|(\u000A))))*)))\+((((((( )|(\u000D)|(\u000A))))*)))))' | |
MINUS = '((((((((( )|(\u000D)|(\u00 |
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 var wb = new XLWorkbook(); | |
var ws = wb.AddWorksheet(); | |
var data = Enumerable.Range(0, 500000).Select(x => new | |
{ | |
One = 1, | |
Two = 2, | |
Three = 3, | |
Four = 3.14, | |
Five = true, |
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 ClosedXML.Excel; | |
namespace ConsoleApp11 | |
{ | |
internal class Program |
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 | |
{ |
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)); |
NewerOlder