Skip to content

Commit 0c35f7c

Browse files
Merge pull request #791: Fixed errors in benchmark workflow file and updated readmes
2 parents 14bf5ea + ded3184 commit 0c35f7c

File tree

3 files changed

+78
-117
lines changed

3 files changed

+78
-117
lines changed

.github/workflows/benchmark.yml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,17 @@ jobs:
3131
BenchmarkMode: Automatic
3232
BenchmarkSection: query
3333
- name: Renaming result file
34-
run: mv MiniExcelLibs.Benchmarks.XlsxBenchmark-report-github.md query-benchmark.md
35-
working-directory: ./benchmarks/MiniExcel.Benchmarks/BenchMarkDotNet.Artifacts/results
34+
run: mv MiniExcelLibs.Benchmarks.BenchmarkSections.QueryXlsxBenchmark-report-github.md query-benchmark.md
35+
working-directory: ./benchmarks/MiniExcel.Benchmarks/BenchmarkDotNet.Artifacts/results
3636
- name: Save benchmark results
3737
uses: actions/upload-artifact@v4
3838
with:
3939
name: query-benchmark-result
40-
path: ./benchmark/MiniExcel.Benchmarks/BenchMarkDotNet.Artifacts/results/*.md
41-
40+
path: ./benchmarks/MiniExcel.Benchmarks/BenchmarkDotNet.Artifacts/results/*.md
41+
4242
CreateBenchmark:
4343
runs-on: ubuntu-latest
44-
44+
4545
steps:
4646
- uses: actions/checkout@v4
4747
- name: Setup .NET
@@ -61,17 +61,17 @@ jobs:
6161
BenchmarkMode: Automatic
6262
BenchmarkSection: create
6363
- name: Renaming result file
64-
run: mv MiniExcelLibs.Benchmarks.XlsxBenchmark-report-github.md create-benchmark.md
65-
working-directory: ./benchmarks/MiniExcel.Benchmarks/BenchMarkDotNet.Artifacts/results
64+
run: mv MiniExcelLibs.Benchmarks.BenchmarkSections.CreateXlsxBenchmark-report-github.md create-benchmark.md
65+
working-directory: ./benchmarks/MiniExcel.Benchmarks/BenchmarkDotNet.Artifacts/results
6666
- name: Save benchmark results
6767
uses: actions/upload-artifact@v4
6868
with:
6969
name: create-benchmark-result
70-
path: ./benchmark/MiniExcel.Benchmarks/BenchMarkDotNet.Artifacts/results/*.md
71-
70+
path: ./benchmarks/MiniExcel.Benchmarks/BenchmarkDotNet.Artifacts/results/*.md
71+
7272
TemplateBenchmark:
7373
runs-on: ubuntu-latest
74-
74+
7575
steps:
7676
- uses: actions/checkout@v4
7777
- name: Setup .NET
@@ -91,27 +91,27 @@ jobs:
9191
BenchmarkMode: Automatic
9292
BenchmarkSection: template
9393
- name: Renaming result file
94-
run: mv MiniExcelLibs.Benchmarks.XlsxBenchmark-report-github.md template-benchmark.md
95-
working-directory: ./benchmarks/MiniExcel.Benchmarks/BenchMarkDotNet.Artifacts/results
94+
run: mv MiniExcelLibs.Benchmarks.BenchmarkSections.TemplateXlsxBenchmark-report-github.md template-benchmark.md
95+
working-directory: ./benchmarks/MiniExcel.Benchmarks/BenchmarkDotNet.Artifacts/results
9696
- name: Save benchmark results
9797
uses: actions/upload-artifact@v4
9898
with:
9999
name: template-benchmark-result
100-
path: ./benchmark/MiniExcel.Benchmarks/BenchMarkDotNet.Artifacts/results/*.md
100+
path: ./benchmarks/MiniExcel.Benchmarks/BenchmarkDotNet.Artifacts/results/*.md
101101

102102
PushBenchmarksResults:
103103
runs-on: ubuntu-latest
104104
needs: [ QueryBenchmark, CreateBenchmark, TemplateBenchmark ]
105-
105+
106106
steps:
107107
- uses: actions/checkout@v4
108108
with:
109109
fetch-depth: 0
110110
- name: Fetch benchmark results
111111
uses: actions/download-artifact@v4
112112
with:
113-
path: ./benchmarks/results
114-
merge-multiple: true
113+
path: ./benchmarks/results
114+
merge-multiple: true
115115
- name: Commit reports
116116
working-directory: ./benchmarks/results
117117
run: |

README-NuGet.md

Lines changed: 34 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ At present, most popular frameworks need to load all the data into the memory to
1515
### Features
1616

1717
- Low memory consumption, avoid OOM (out of memory) and full GC
18-
- Support `real-time` operation of each row of data
19-
- Support LINQ deferred execution, it can do low-consumption, fast paging and other complex queries
20-
- Lightweight, without Microsoft Office installed, no COM+, DLL size is less than 150KB
18+
- Supports real time operation of each row of data
19+
- Supports LINQ deferred execution, it can do low-consumption, fast paging and other complex queries
20+
- Lightweight, without Microsoft Office installed, no COM+, DLL size is less than 400KB
2121
- Easy API style to read/write/fill excel
2222

2323
### Get Started
@@ -48,55 +48,52 @@ Please Check [TODO](https://github.com/mini-software/MiniExcel/projects/1?fulls
4848

4949
### Performance
5050

51-
Benchmarks logic can be found in [MiniExcel.Benchmarks](benchmarks/MiniExcel.Benchmarks/Program.cs) , and test cli
51+
The code for the benchmarks can be found in [MiniExcel.Benchmarks](https://github.com/mini-software/MiniExcel/tree/master/benchmarks/MiniExcel.Benchmarks).
52+
To run all the benchmarks use:
5253

5354
```bash
54-
dotnet run -p .\benchmarks\MiniExcel.Benchmarks\ -c Release -f netcoreapp3.1 -- -f * --join
55+
dotnet run -project .\benchmarks\MiniExcel.Benchmarks -c Release -f net9.0 -filter * --join
5556
```
5657

57-
Output from the latest run is :
58-
59-
```bash
60-
BenchmarkDotNet=v0.12.1, OS=Windows 10.0.19042
61-
Intel Core i7-7700 CPU 3.60GHz (Kaby Lake), 1 CPU, 8 logical and 4 physical cores
62-
[Host] : .NET Framework 4.8 (4.8.4341.0), X64 RyuJIT
63-
Job-ZYYABG : .NET Framework 4.8 (4.8.4341.0), X64 RyuJIT
64-
IterationCount=3 LaunchCount=3 WarmupCount=3
58+
Hardware and settings used are the following:
59+
```
60+
BenchmarkDotNet v0.15.0, Linux Ubuntu 24.04.2 LTS (Noble Numbat)
61+
AMD EPYC 7763, 1 CPU, 4 logical and 2 physical cores
62+
.NET SDK 9.0.300
63+
[Host] : .NET 9.0.5 (9.0.525.21509), X64 RyuJIT AVX2
64+
ShortRun : .NET 9.0.5 (9.0.525.21509), X64 RyuJIT AVX2
6565
```
66-
67-
Benchmark History : [Link](https://github.com/mini-software/MiniExcel/issues/276)
68-
69-
7066

7167
#### Import/Query Excel
7268

73-
Logic : [**Test1,000,000x10.xlsx**](benchmarks/MiniExcel.Benchmarks/Test1%2C000%2C000x10.xlsx) as performance test basic file, 1,000,000 rows * 10 columns "HelloWorld" cells, 23 MB file size
69+
The file used to test performance is [**Test1,000,000x10.xlsx**](https://github.com/mini-software/MiniExcel/tree/master/benchmarks/MiniExcel.Benchmarks/Test1%2C000%2C000x10.xlsx), a 32MB document containing 1,000,000 rows * 10 columns whose cells are filled with the string "HelloWorld".
7470

71+
| Method | Mean | StdDev | Error | Gen0 | Gen1 | Gen2 | Allocated |
72+
|--------------------------------------|-----------------:|---------------:|-----------------:|------------:|------------:|----------:|--------------:|
73+
| 'MiniExcel QueryFirst' | 63.70 μs | 0.337 μs | 6.144 μs | 2.9297 | 2.7669 | - | 49.67 KB |
74+
| 'ExcelDataReader QueryFirst' | 5,010,679.51 μs | 53,245.186 μs | 971,390.400 μs | 105000.0000 | 333.3333 | - | 1717272.56 KB |
75+
| 'MiniExcel Query' | 9,172,286.91 μs | 12,805.326 μs | 233,616.824 μs | 448500.0000 | 4666.6667 | - | 7327883.36 KB |
76+
| 'ExcelDataReader Query' | 10,609,617.09 μs | 29,055.953 μs | 530,088.745 μs | 275666.6667 | 68666.6667 | - | 4504691.87 KB |
77+
| 'Epplus QueryFirst' | 13,770,656.24 μs | 45,909.809 μs | 837,565.827 μs | 174333.3333 | 88833.3333 | 4333.3333 | 3700587.76 KB |
78+
| 'Epplus Query' | 19,257,306.83 μs | 63,117.956 μs | 1,151,506.486 μs | 452333.3333 | 90500.0000 | 5333.3333 | 8223933.16 KB |
79+
| 'ClosedXml Query' | 31,070,263.83 μs | 342,973.671 μs | 6,257,116.502 μs | 401666.6667 | 104166.6667 | 3333.3333 | 6822559.68 KB |
80+
| 'ClosedXml QueryFirst' | 31,141,877.48 μs | 21,006.538 μs | 383,237.459 μs | 402166.6667 | 104833.3333 | 3833.3333 | 6738357.8 KB |
81+
| 'OpenXmlSDK QueryFirst' | 31,750,686.63 μs | 263,328.569 μs | 4,804,093.357 μs | 374666.6667 | 374500.0000 | 3166.6667 | 6069266.96 KB |
82+
| 'OpenXmlSDK Query' | 32,919,119.46 μs | 411,395.682 μs | 7,505,388.691 μs | 374666.6667 | 374500.0000 | 3166.6667 | 6078467.83 KB |
7583

76-
| Library | Method | Max Memory Usage | Mean |
77-
| ---------------------------- | -------------: | ---------------: | ---------------: |
78-
| MiniExcel | 'MiniExcel QueryFirst' | 0.109 MB | 0.0007264 sec |
79-
| ExcelDataReader | 'ExcelDataReader QueryFirst' | 15.24 MB | 10.66421 sec |
80-
| MiniExcel | 'MiniExcel Query' | 17.3 MB | 14.17933 sec |
81-
| ExcelDataReader | 'ExcelDataReader Query' | 17.3 MB | 22.56508 sec |
82-
| Epplus | 'Epplus QueryFirst' | 1,452 MB | 18.19801 sec |
83-
| Epplus | 'Epplus Query' | 1,451 MB | 23.64747 sec |
84-
| OpenXmlSDK | 'OpenXmlSDK Query' | 1,412 MB | 52.00327 sec |
85-
| OpenXmlSDK | 'OpenXmlSDK QueryFirst' | 1,413 MB | 52.34865 sec |
86-
| ClosedXml | 'ClosedXml QueryFirst' | 2,158 MB | 66.18897 sec |
87-
| ClosedXml | 'ClosedXml Query' | 2,184 MB | 191.43412 sec |
8884

8985
#### Export/Create Excel
9086

91-
Logic : create a total of 10,000,000 "HelloWorld" excel
87+
Logic: create a total of 10,000,000 "HelloWorld" cells Excel document
9288

93-
| Library | Method | Max Memory Usage | Mean |
94-
| ------------------------ | -------------: | ---------------: | -----------: |
95-
| MiniExcel | 'MiniExcel Create Xlsx' | 15 MB | 11.53181 sec |
96-
| Epplus | 'Epplus Create Xlsx' | 1,204 MB | 22.50971 sec |
97-
| OpenXmlSdk | 'OpenXmlSdk Create Xlsx' | 2,621 MB | 42.47399 sec |
98-
| ClosedXml | 'ClosedXml Create Xlsx' | 7,141 MB | 140.93992 sec |
89+
| Method | Mean | StdDev | Error | Gen0 | Gen1 | Gen2 | Allocated |
90+
|----------------------------------------------|---------:|---------:|---------:|------------:|------------:|----------:|----------:|
91+
| 'MiniExcel Create Xlsx' | 4.427 s | 0.0056 s | 0.1023 s | 251666.6667 | 1833.3333 | 1666.6667 | 3.92 GB |
92+
| 'OpenXmlSdk Create Xlsx by DOM mode' | 22.729 s | 0.1226 s | 2.2374 s | 307000.0000 | 306833.3333 | 3833.3333 | 6.22 GB |
93+
| 'ClosedXml Create Xlsx' | 22.851 s | 0.0190 s | 0.3473 s | 195500.0000 | 54500.0000 | 4166.6667 | 4.48 GB |
94+
| 'Epplus Create Xlsx' | 23.027 s | 0.0088 s | 0.1596 s | 89000.0000 | 17500.0000 | 6000.0000 | 2.51 GB |
9995

96+
Warning: these results may be outdated. You can find the benchmarks for the latest release [here](https://github.com/mini-software/MiniExcel/tree/master/benchmarks/results).
10097

10198

10299
### Documents

README.md

Lines changed: 28 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div align="center">
1+
<div style="text-align: center">
22
<p><a href="https://www.nuget.org/packages/MiniExcel"><img src="https://img.shields.io/nuget/v/MiniExcel.svg" alt="NuGet"></a> <a href="https://www.nuget.org/packages/MiniExcel"><img src="https://img.shields.io/nuget/dt/MiniExcel.svg" alt=""></a>
33
<a href="https://ci.appveyor.com/project/mini-software/miniexcel/branch/master"><img src="https://ci.appveyor.com/api/projects/status/b2vustrwsuqx45f4/branch/master?svg=true" alt="Build status"></a>
44
<a href="https://gitee.com/dotnetchina/MiniExcel"><img src="https://gitee.com/dotnetchina/MiniExcel/badge/star.svg" alt="star"></a> <a href="https://github.com/mini-software/MiniExcel" rel="nofollow"><img src="https://img.shields.io/github/stars/mini-software/MiniExcel?logo=github" alt="GitHub stars"></a>
@@ -11,19 +11,19 @@
1111

1212
[<img align="right" src="https://github.com/dotnet-foundation/swag/blob/main/logo/dotnetfoundation_v4.png?raw=true" width="100" />](https://www.dotnetfoundation.org/)
1313

14-
<div align="center">
14+
<div style="text-align: center">
1515
<p>This project is part of the <a href="https://www.dotnetfoundation.org/">.NET Foundation</a> and operates under their <a href="https://www.dotnetfoundation.org/code-of-conduct">code of conduct</a>. </p>
1616
</div>
1717

1818
---
1919

20-
<div align="center">
20+
<div style="text-align: center">
2121
<p><strong><a href="README.md">English</a> | <a href="README.zh-CN.md">简体中文</a> | <a href="README.zh-Hant.md">繁體中文</a></strong></p>
2222
</div>
2323

2424
---
2525

26-
<div align="center">
26+
<div style="text-align: center">
2727
Your <a href="https://github.com/mini-software/MiniExcel">Star</a> and <a href="https://miniexcel.github.io">Donate</a> can make MiniExcel better
2828
</div>
2929

@@ -43,9 +43,9 @@ At present, most popular frameworks need to load all the data into the memory to
4343
### Features
4444

4545
- Low memory consumption, avoid OOM (out of memory) and full GC
46-
- Support `real-time` operation of each row of data
47-
- Support LINQ deferred execution, it can do low-consumption, fast paging and other complex queries
48-
- Lightweight, without Microsoft Office installed, no COM+, DLL size is less than 150KB
46+
- Supports real time operation of each row of data
47+
- Supports LINQ deferred execution, it can do low-consumption, fast paging and other complex queries
48+
- Lightweight, without Microsoft Office installed, no COM+, DLL size is less than 400KB
4949
- Easy API style to read/write/fill excel
5050

5151
### Get Started
@@ -76,54 +76,18 @@ Please Check [TODO](https://github.com/mini-software/MiniExcel/projects/1?fulls
7676

7777
### Performance
7878

79-
Benchmarks logic can be found in [MiniExcel.Benchmarks](benchmarks/MiniExcel.Benchmarks/Program.cs) , and test cli
79+
The code for the benchmarks can be found in [MiniExcel.Benchmarks](benchmarks/MiniExcel.Benchmarks/Program.cs).
8080

81-
```bash
82-
dotnet run -p .\benchmarks\MiniExcel.Benchmarks\ -c Release -f netcoreapp3.1 -- -f * --join
83-
```
81+
The file used to test performance is [**Test1,000,000x10.xlsx**](benchmarks/MiniExcel.Benchmarks/Test1%2C000%2C000x10.xlsx), a 32MB document containing 1,000,000 rows * 10 columns whose cells are filled with the string "HelloWorld".
8482

85-
Output from the latest run is :
83+
To run all the benchmarks use:
8684

8785
```bash
88-
BenchmarkDotNet=v0.12.1, OS=Windows 10.0.19042
89-
Intel Core i7-7700 CPU 3.60GHz (Kaby Lake), 1 CPU, 8 logical and 4 physical cores
90-
[Host] : .NET Framework 4.8 (4.8.4341.0), X64 RyuJIT
91-
Job-ZYYABG : .NET Framework 4.8 (4.8.4341.0), X64 RyuJIT
92-
IterationCount=3 LaunchCount=3 WarmupCount=3
86+
dotnet run -project .\benchmarks\MiniExcel.Benchmarks -c Release -f net9.0 -filter * --join
9387
```
9488

95-
Benchmark History : [Link](https://github.com/mini-software/MiniExcel/issues/276)
96-
97-
98-
99-
#### Import/Query Excel
100-
101-
Logic : [**Test1,000,000x10.xlsx**](benchmarks/MiniExcel.Benchmarks/Test1%2C000%2C000x10.xlsx) as performance test basic file, 1,000,000 rows * 10 columns "HelloWorld" cells, 23 MB file size
102-
103-
104-
| Library | Method | Max Memory Usage | Mean |
105-
| ---------------------------- | -------------: | ---------------: | ---------------: |
106-
| MiniExcel | 'MiniExcel QueryFirst' | 0.109 MB | 0.0007264 sec |
107-
| ExcelDataReader | 'ExcelDataReader QueryFirst' | 15.24 MB | 10.66421 sec |
108-
| MiniExcel | 'MiniExcel Query' | 17.3 MB | 14.17933 sec |
109-
| ExcelDataReader | 'ExcelDataReader Query' | 17.3 MB | 22.56508 sec |
110-
| Epplus | 'Epplus QueryFirst' | 1,452 MB | 18.19801 sec |
111-
| Epplus | 'Epplus Query' | 1,451 MB | 23.64747 sec |
112-
| OpenXmlSDK | 'OpenXmlSDK Query' | 1,412 MB | 52.00327 sec |
113-
| OpenXmlSDK | 'OpenXmlSDK QueryFirst' | 1,413 MB | 52.34865 sec |
114-
| ClosedXml | 'ClosedXml QueryFirst' | 2,158 MB | 66.18897 sec |
115-
| ClosedXml | 'ClosedXml Query' | 2,184 MB | 191.43412 sec |
116-
117-
#### Export/Create Excel
118-
119-
Logic : create a total of 10,000,000 "HelloWorld" excel
89+
You can find the benchmarks' results for the latest release [here](benchmarks/results).
12090

121-
| Library | Method | Max Memory Usage | Mean |
122-
| ------------------------ | -------------: | ---------------: | -----------: |
123-
| MiniExcel | 'MiniExcel Create Xlsx' | 15 MB | 11.53181 sec |
124-
| Epplus | 'Epplus Create Xlsx' | 1,204 MB | 22.50971 sec |
125-
| OpenXmlSdk | 'OpenXmlSdk Create Xlsx' | 2,621 MB | 42.47399 sec |
126-
| ClosedXml | 'ClosedXml Create Xlsx' | 7,141 MB | 140.93992 sec |
12791

12892
### Excel Query/Import <a name="getstart1"></a>
12993

@@ -156,9 +120,9 @@ using (var stream = File.OpenRead(path))
156120

157121
* dynamic key is `A.B.C.D..`
158122

159-
| MiniExcel | 1 |
160-
| -------- | -------- |
161-
| Github | 2 |
123+
| MiniExcel | 1 |
124+
|-----------|---|
125+
| Github | 2 |
162126

163127
```csharp
164128

@@ -182,10 +146,10 @@ note : same column name use last right one
182146

183147
Input Excel :
184148

185-
| Column1 | Column2 |
186-
| -------- | -------- |
187-
| MiniExcel | 1 |
188-
| Github | 2 |
149+
| Column1 | Column2 |
150+
|-----------|---------|
151+
| MiniExcel | 1 |
152+
| Github | 2 |
189153

190154

191155
```csharp
@@ -372,10 +336,10 @@ MiniExcel.SaveAs(path, values);
372336

373337
Create File Result :
374338

375-
| Column1 | Column2 |
376-
| -------- | -------- |
377-
| MiniExcel | 1 |
378-
| Github | 2 |
339+
| Column1 | Column2 |
340+
|-----------|---------|
341+
| MiniExcel | 1 |
342+
| Github | 2 |
379343

380344

381345
#### 3. IDataReader
@@ -993,11 +957,11 @@ When the template is rendered, the `$` prefix will be removed and `$enumrowstart
993957

994958
##### 2. Other Example Formulas:
995959

996-
| | |
997-
|------------|-----------------------------------------------------------------------------------------|
998-
|Sum |`$=SUM(C{{$enumrowstart}}:C{{$enumrowend}})` |
999-
|Alt. Average|`$=SUM(C{{$enumrowstart}}:C{{$enumrowend}}) / COUNT(C{{$enumrowstart}}:C{{$enumrowend}})`|
1000-
|Range |`$=MAX(C{{$enumrowstart}}:C{{$enumrowend}}) - MIN(C{{$enumrowstart}}:C{{$enumrowend}})` |
960+
| | |
961+
|--------------|-------------------------------------------------------------------------------------------|
962+
| Sum | `$=SUM(C{{$enumrowstart}}:C{{$enumrowend}})` |
963+
| Alt. Average | `$=SUM(C{{$enumrowstart}}:C{{$enumrowend}}) / COUNT(C{{$enumrowstart}}:C{{$enumrowend}})` |
964+
| Range | `$=MAX(C{{$enumrowstart}}:C{{$enumrowend}}) - MIN(C{{$enumrowstart}}:C{{$enumrowend}})` |
1001965

1002966

1003967
#### 11. Other

0 commit comments

Comments
 (0)