简体   繁体   English

是否有人拥有.Net Excel IO组件基准测试?

[英]Does anyone have .Net Excel IO component benchmarks?

I'm needing to access Excel workbooks from .Net. 我需要从.Net访问Excel工作簿。 I know all about the different ways of doing it (I've written them up in a blog post ), and I know that using a native .Net component is going to be the fastest. 我知道所有不同的实现方式(我已经在博客文章中将它们写了出来),而且我知道使用本机.Net组件将是最快的。 But the question is, which of the components wins? 但是问题是,哪个组件胜出? Has anybody benchmarked them? 有人对它们进行了基准测试吗? I've been using Syncfusion XlsIO, but that's very slow for some key operations (like deleting rows in a workbook containing thousands of Named ranges). 我一直在使用Syncfusion XlsIO,但这对于某些关键操作(例如,删除包含数千个命名范围的工作簿中的行)来说非常慢。

I haven't done any proper benchmarks, but I tried out several other components,and found that SpreadsheetGear was considerably faster than XlsIO which I was using before. 我没有做任何适当的基准测试,但是我尝试了其他几个组件,发现SpreadsheetGear比我以前使用的XlsIO快得多。 I've written up some of my findings in this post 我已经在这篇文章中写下了我的一些发现

Can't help you with your original question, but are you aware that you can access Excel files using an OleDbConnection, and therefore treat it as a database? 无法解决您的原始问题,但是您知道可以使用OleDbConnection访问Excel文件,并将其视为数据库吗? You can then read worksheets into a DataTable, perform all the changes you need to the data in your application, and then save it all back to the file using an OleDbConnection. 然后,您可以将工作表读入DataTable,对应用程序中的数据执行所需的所有更改,然后使用OleDbConnection将其全部保存回文件中。

Yes but I'm not going to publish them both out of a courtesy to Syncfusion (they ask you not to publish benchmarks), because I'm not an experienced tester so my tests are probably somewhat flawed but mostly because what you actually benchmark makes a huge difference to who wins and by how much. 是的,但是我不会出于对Syncfusion的礼貌而将它们都发布(他们要求您不要发布基准),因为我不是经验丰富的测试人员,因此我的测试可能存在一些缺陷,但主要是因为您实际进行基准测试的原因谁获胜以及获胜的数量巨大的差异。

I took one of their "performance" examples and added the same routine in EPPlus to compare them. 我采用了其中一个“性能”示例,并在EPPlus中添加了相同的例程来进行比较。 XLSIO was around 15% faster with just straightforward inserts, depending on the row/column ratio (I tried a few), memory usage seemed very similar. 仅凭简单的插入操作,XLSIO的速度提高了15%左右,具体取决于行/列的比率(我尝试了几次),内存使用情况看起来非常相似。 When I added a routine that, after all the rows were added, deleted every 10th row and then inserted a new row 2 rows up from that - XLSIO was significantly slower in that circumstance. 当我添加一个例程后,在添加完所有行之后,每隔第10行删除一次,然后在该行的第2行之前插入新行-在这种情况下,XLSIO的运行速度明显降低。

A generic benchmark is pretty-much useless to you. 通用基准对您几乎没有用。 You need to try them against each other in the specific scenarios you use. 您需要在使用的特定方案中相互尝试。

I have been using EPPlus for a few years and the performance has been fine, I don't recall shouting at it. 我已经使用EPPlus几年了,性能也不错,我不记得大喊大叫了。

More worthy of your consideration is the functionality, support (Syncfusion have been good, in my experience), Documentation, access to the source code if that is important, and - importantly - how much sense the API makes to you, the syntax can be quite different. 更值得考虑的是功能,支持(以我的经验,Syncfusion很好),文档,对源代码的访问(如果很重要),以及-重要的是-API对您有多大意义,语法可以是很不一样。 eg. 例如。 Named Styles 命名样式

XLSIO XLSIO

headerStyle.BeginUpdate();
workbook.SetPaletteColor(8, System.Drawing.Color.FromArgb(255, 174, 33));
headerStyle.Color = System.Drawing.Color.FromArgb(255, 174, 33);
headerStyle.Font.Bold = true;
headerStyle.Borders[ExcelBordersIndex.EdgeLeft]  .LineStyle = ExcelLineStyle.Thin;
headerStyle.Borders[ExcelBordersIndex.EdgeRight] .LineStyle = ExcelLineStyle.Thin;
headerStyle.Borders[ExcelBordersIndex.EdgeTop]   .LineStyle = ExcelLineStyle.Thin;
headerStyle.Borders[ExcelBordersIndex.EdgeBottom].LineStyle = ExcelLineStyle.Thin;
headerStyle.EndUpdate();

EPPlus EPPlus

ExcelNamedStyleXml headerStyle = xlPackage.Workbook.Styles.CreateNamedStyle("HeaderStyle");
headerStyle.Style.Fill.PatternType = ExcelFillStyle.Solid; // <== needed or BackgroundColor throws an exception
headerStyle.Style.Fill.BackgroundColor.SetColor(System.Drawing.Color.FromArgb(255, 174, 33));
headerStyle.Style.Font.Bold = true;
headerStyle.Style.Border.Left.Style   = ExcelBorderStyle.Thin;
headerStyle.Style.Border.Right.Style  = ExcelBorderStyle.Thin;
headerStyle.Style.Border.Top.Style    = ExcelBorderStyle.Thin;
headerStyle.Style.Border.Bottom.Style = ExcelBorderStyle.Thin;

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 有没有人有从.Net应用程序控制多个Excel实例的好例子? - Does anyone have a good example of controlling multiple Excel instances from a .Net app? 有没有人使用.NET的System.IO.IsolatedStorage? - Does anyone use .NET's System.IO.IsolatedStorage? 有没有人对[Authorize]属性如何处理标准ASP.NET MVC 5应用程序中的路由有一个很好的解释? - Does anyone have a good explanation on how the [Authorize] Attribute handles routes in a standard ASP.NET MVC 5 application? 有没有人有一个.NET程序的好例子,它保持驻留内存并在计时器上运行一个动作? - Does anyone have any good examples of a .NET program that stays memory resident and runs an action on a timer? 是否还有其他人对 Azure Batch 成功完成 .NET 中试用订阅的示例任务有疑问? - Does anyone else have issues with Azure Batch successfully completing sample tasks on a trial subscription in .NET? 有谁知道.NET中的钱类型? - Does anyone know of a money type in .NET? Quickbooks API-.NET-QBD-V2-有人在C#中有有效的示例,说明如何删除或还原错误的对象吗? - Quickbooks API - .NET - QBD - V2 - Does anyone have working example in C# of how to delete or revert errored objects? 有人知道我该怎么做吗? Excel中的C#错误 - Anyone knows what i have to do ? Excel in C# Error .NET 有链接器吗? - Does .NET have a linker? 有人对C#具有自适应霍夫曼压缩功能吗? - Does anyone have Adaptive Huffman compression for C#?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM