-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #87 from sveinungf/dev/addheaderrow
AddHeaderRowAsync
- Loading branch information
Showing
49 changed files
with
491 additions
and
260 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
using BenchmarkDotNet.Attributes; | ||
using BenchmarkDotNet.Jobs; | ||
using SpreadCheetah.Styling; | ||
|
||
namespace SpreadCheetah.Benchmark.Benchmarks; | ||
|
||
[SimpleJob(RuntimeMoniker.Net48)] | ||
[SimpleJob(RuntimeMoniker.Net90)] | ||
[MemoryDiagnoser] | ||
public class AddHeaderRow | ||
{ | ||
private static readonly string[] HeaderNames = | ||
[ | ||
"Id", | ||
"First name", | ||
"Last name", | ||
"Date of birth", | ||
"E-mail", | ||
"Role" | ||
]; | ||
|
||
[Params(100000)] | ||
public int NumberOfRows { get; set; } | ||
|
||
[Benchmark] | ||
public async Task SpreadCheetahAddHeaderRow() | ||
{ | ||
var options = new SpreadCheetahOptions { DefaultDateTimeFormat = null }; | ||
await using var spreadsheet = await Spreadsheet.CreateNewAsync(Stream.Null, options); | ||
await spreadsheet.StartWorksheetAsync("Book1"); | ||
var style = new Style { Font = { Bold = true } }; | ||
var styleId = spreadsheet.AddStyle(style); | ||
|
||
for (var i = 0; i < NumberOfRows; ++i) | ||
{ | ||
await spreadsheet.AddHeaderRowAsync(HeaderNames, styleId); | ||
} | ||
|
||
await spreadsheet.FinishAsync(); | ||
} | ||
} |
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
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.