Skip to content

Commit ff41292

Browse files
authored
Update project structure and restore core functionality (#866)
- Changed target framework in `MiniExcel.Benchmarks.csproj` from `net10.0` to `net9.0`. - Removed `net10.0` from target frameworks in `Directory.Build.props`. - Updated copyright notice in `Directory.Build.props`. - Added `icon.png` and `README.md` to packaging in `Directory.Build.props`. - Reintroduced attribute classes in `Attributes.cs` for Excel columns. - Added `IConfiguration` interface and implementations in `Configuration.cs`. - Defined `ExcelType` enum in `ExcelType.cs`. - Restored `ExcelTypeHelper.cs` for determining Excel types. - Reintroduced core functionality in `MiniExcel.cs` for Excel file operations. - Added new `README.md` with project details and instructions.
1 parent da85e91 commit ff41292

File tree

8 files changed

+109
-4
lines changed

8 files changed

+109
-4
lines changed

benchmarks/MiniExcel.Benchmarks/MiniExcel.Benchmarks.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFrameworks>net8.0;net10.0</TargetFrameworks>
5+
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
66
<Nullable>enable</Nullable>
77
<ImplicitUsings>enable</ImplicitUsings>
88
<LangVersion>latest</LangVersion>

src/Directory.Build.props

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project>
22

33
<PropertyGroup>
4-
<TargetFrameworks>netstandard2.0;net8.0;net10.0</TargetFrameworks>
4+
<TargetFrameworks>netstandard2.0;net8.0</TargetFrameworks>
55
<Version>2.0.0-preview.1</Version>
66
<Nullable>enable</Nullable>
77
<ImplicitUsings>enable</ImplicitUsings>
@@ -18,9 +18,8 @@
1818
Issues : https://github.com/mini-software/MiniExcel/issues
1919
Todo : https://github.com/mini-software/MiniExcel/projects/1?fullscreen=true</Description>
2020
<Authors>Wei Lin, Michele Bastione, PING-HSIU SHIH, Amos(izanhzh), eynarhaji, Mini-Software team</Authors>
21-
<Copyright>Wei Lin, 2021 onwards</Copyright>
21+
<Copyright>Mini-Software, 2021 onwards</Copyright>
2222
<NeutralLanguage>en</NeutralLanguage>
23-
<PackageLicenseUrl>https://raw.githubusercontent.com/mini-software/MiniExcel/master/LICENSE</PackageLicenseUrl>
2423
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
2524
<PackageProjectUrl>https://github.com/mini-software/MiniExcel</PackageProjectUrl>
2625
<RepositoryUrl>https://github.com/mini-software/MiniExcel</RepositoryUrl>
@@ -38,4 +37,9 @@
3837
<AssemblyOriginatorKeyFile>..\miniexcel.snk</AssemblyOriginatorKeyFile>
3938
</PropertyGroup>
4039

40+
<ItemGroup>
41+
<None Include="../icon.png" Pack="true" PackagePath="\" />
42+
<None Include="../README.md" Pack="true" PackagePath="\" />
43+
</ItemGroup>
44+
4145
</Project>

src/README.md

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
2+
This project is part of the [.NET Foundation](https://dotnetfoundation.org/projects/project-detail/miniexcel) and operates under their code of conduct.
3+
4+
---
5+
6+
### Introduction
7+
8+
MiniExcel is simple and efficient to avoid OOM's .NET processing Excel tool.
9+
10+
At present, most popular frameworks need to load all the data into the memory to facilitate operation, but it will cause memory consumption problems. MiniExcel tries to use algorithm from a stream to reduce the original 1000 MB occupation to a few MB to avoid OOM(out of memory).
11+
12+
![image](https://user-images.githubusercontent.com/12729184/113086657-ab8bd000-9214-11eb-9563-c970ac1ee35e.png)
13+
14+
15+
### Features
16+
17+
- Low memory consumption, avoid OOM (out of memory) and full GC
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
21+
- Easy API style to read/write/fill excel
22+
23+
### Get Started
24+
25+
- [Import/Query Excel](#getstart1)
26+
27+
- [Export/Create Excel](#getstart2)
28+
29+
- [Excel Template](#getstart3)
30+
31+
- [Excel Column Name/Index/Ignore Attribute](#getstart4)
32+
33+
- [Examples](#getstart5)
34+
35+
36+
37+
### Installation
38+
39+
You can install the package [from NuGet](https://www.nuget.org/packages/MiniExcel)
40+
41+
### Release Notes
42+
43+
Please Check [Release Notes](docs)
44+
45+
### TODO
46+
47+
Please Check [TODO](https://github.com/mini-software/MiniExcel/projects/1?fullscreen=true)
48+
49+
### Performance
50+
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:
53+
54+
```bash
55+
dotnet run -project .\benchmarks\MiniExcel.Benchmarks -c Release -f net9.0 -filter * --join
56+
```
57+
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
65+
```
66+
67+
#### Import/Query Excel
68+
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".
70+
71+
| Method | Mean | StdDev | Error | Gen0 | Gen1 | Gen2 | Allocated |
72+
|--------------------------------------|-----------------:|---------------:|-----------------:|------------:|------------:|----------:|--------------:|
73+
| &#39;MiniExcel QueryFirst&#39; | 63.70 μs | 0.337 μs | 6.144 μs | 2.9297 | 2.7669 | - | 49.67 KB |
74+
| &#39;ExcelDataReader QueryFirst&#39; | 5,010,679.51 μs | 53,245.186 μs | 971,390.400 μs | 105000.0000 | 333.3333 | - | 1717272.56 KB |
75+
| &#39;MiniExcel Query&#39; | 9,172,286.91 μs | 12,805.326 μs | 233,616.824 μs | 448500.0000 | 4666.6667 | - | 7327883.36 KB |
76+
| &#39;ExcelDataReader Query&#39; | 10,609,617.09 μs | 29,055.953 μs | 530,088.745 μs | 275666.6667 | 68666.6667 | - | 4504691.87 KB |
77+
| &#39;Epplus QueryFirst&#39; | 13,770,656.24 μs | 45,909.809 μs | 837,565.827 μs | 174333.3333 | 88833.3333 | 4333.3333 | 3700587.76 KB |
78+
| &#39;Epplus Query&#39; | 19,257,306.83 μs | 63,117.956 μs | 1,151,506.486 μs | 452333.3333 | 90500.0000 | 5333.3333 | 8223933.16 KB |
79+
| &#39;ClosedXml Query&#39; | 31,070,263.83 μs | 342,973.671 μs | 6,257,116.502 μs | 401666.6667 | 104166.6667 | 3333.3333 | 6822559.68 KB |
80+
| &#39;ClosedXml QueryFirst&#39; | 31,141,877.48 μs | 21,006.538 μs | 383,237.459 μs | 402166.6667 | 104833.3333 | 3833.3333 | 6738357.8 KB |
81+
| &#39;OpenXmlSDK QueryFirst&#39; | 31,750,686.63 μs | 263,328.569 μs | 4,804,093.357 μs | 374666.6667 | 374500.0000 | 3166.6667 | 6069266.96 KB |
82+
| &#39;OpenXmlSDK Query&#39; | 32,919,119.46 μs | 411,395.682 μs | 7,505,388.691 μs | 374666.6667 | 374500.0000 | 3166.6667 | 6078467.83 KB |
83+
84+
85+
#### Export/Create Excel
86+
87+
Logic: create a total of 10,000,000 "HelloWorld" cells Excel document
88+
89+
| Method | Mean | StdDev | Error | Gen0 | Gen1 | Gen2 | Allocated |
90+
|----------------------------------------------|---------:|---------:|---------:|------------:|------------:|----------:|----------:|
91+
| &#39;MiniExcel Create Xlsx&#39; | 4.427 s | 0.0056 s | 0.1023 s | 251666.6667 | 1833.3333 | 1666.6667 | 3.92 GB |
92+
| &#39;OpenXmlSdk Create Xlsx by DOM mode&#39; | 22.729 s | 0.1226 s | 2.2374 s | 307000.0000 | 306833.3333 | 3833.3333 | 6.22 GB |
93+
| &#39;ClosedXml Create Xlsx&#39; | 22.851 s | 0.0190 s | 0.3473 s | 195500.0000 | 54500.0000 | 4166.6667 | 4.48 GB |
94+
| &#39;Epplus Create Xlsx&#39; | 23.027 s | 0.0088 s | 0.1596 s | 89000.0000 | 17500.0000 | 6000.0000 | 2.51 GB |
95+
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).
97+
98+
99+
### Documents
100+
101+
https://github.com/mini-software/MiniExcel

0 commit comments

Comments
 (0)