NPOI 대체 스프레드시트 API, GcExcel 성능 테스트
페이지 정보
작성자 GrapeCity 작성일 2022-06-16 09:14 조회 967회 댓글 0건본문
관련링크
GrapeCity는 새로운 버전을 릴리스할 때마다 GcExcel의 성능을 지속적으로 모니터링 해왔습니다. Windows, macOS, Linux 플랫폼에서 GcExcel의 로드, 저장 및 계산 작업에 소요되는 수행 시간과 메모리 사용량을 다른 경쟁 제품과 비교하여 기록했습니다. 철저한 성능 테스트를 통해 GcExcel이 NPOI 또는 유사한 다른 API의 대안을 모색하거나 현재 응용 프로그램의 성능을 개선하는 데 도움이 될 것으로 확신합니다.
성능 메트릭 및 데이터
테스트 시스템 구성
- Windows: Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz 3.19 GHz, x64 기반 프로세서, Windows 10 Pro 20H2 Build 19042.1052
- MacOS: Intel i9, 2.3GHz/MacOS Catalina v10.15.6
- Linux: CPU: 4코어 Intel(R) Xeon(R) CPU E5-2683 v3, 2.00GHz, 4GB
비교에 사용한 빌드
이 비교에서는 다음 GcExcel 및 경쟁 제품 빌드 버전을 참조합니다.
경쟁 제품 #1
경쟁 제품 #2()
테스트 데이터
처음 세 가지 테스트에서는 double, string 및 date 값 유형으로 100,000개 행 x 30개 열(3,000,000개 셀)을 채워 Set Values, Get Values 및 Save to XLSX, 총 사용된 메모리 (가비지 수집이 언제든지 발생할 수 있기 때문에 정확하게 측정하기 어려움) 에 대한 성능을 측정합니다.
이러한 테스트는 다음과 같습니다(문자열 테스트에서는 하드 코딩된 문자열 값 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"를 사용하고 날짜 테스트에서는 new Date() 객체를 생성하며, 그 외에는 동일).
GcExcel 이중 성능 테스트
public static void TestSetRangeValues_Double(int rowCount, int columnCount, ref double setTime, ref double getTime, ref double saveTime, ref double usedMem) { Console.WriteLine(); Console.WriteLine(string.Format("GcExcel benchmark for double values with {0} rows and {1} columns", rowCount, columnCount)); IWorkbook workbook = new Workbook(); IWorksheet worksheet = workbook.Worksheets[0]; Stopwatch watch = new Stopwatch(); watch.Start(); double[,] values = new double[rowCount, columnCount]; for (int i = 0; i < rowCount; i++) { for (int j = 0; j < columnCount; j++) { values[i, j] = i + j; } } worksheet.Range[0, 0, rowCount, columnCount].Value = values; watch.Stop(); setTime = watch.ElapsedMilliseconds / 1000d; Console.WriteLine(string.Format("GcExcel set double values: {0:N3} s", setTime)); watch.Start(); object tmpValues = worksheet.Range[0, 0, rowCount, columnCount].Value; watch.Stop(); getTime = watch.ElapsedMilliseconds / 1000d; ; Console.WriteLine(string.Format("GcExcel get double values: {0:N3} s", getTime)); watch.Start(); workbook.Save("../../output/gcexcel-saved-doubles.xlsx"); watch.Stop(); saveTime = watch.ElapsedMilliseconds / 1000d; ; Console.WriteLine(string.Format("GcExcel save doubles to Excel: {0:N3} s", saveTime)); }
마지막 2개 테스트에서는 계산 성능에 더 집중합니다.
다음 테스트에서 이 통합 문서는 워크시트가 계산될 때마다 재계산해야 하는 휘발성 함수를 사용하는 여러 수식이 포함된 대규모 XLSX를 로드하고 파일 열기, 계산, XLSX로 저장, 사용된 메모리 합계 등의 성능을 측정합니다.
이 테스트는 다음과 같습니다.
GcExcel 개방형 대규모 XLSX 성능 테스트
public static void TestBigExcelFile(int rowCount, int columnCount, ref double openTime, ref double calcTime, ref double saveTime, ref double usedMem) { Console.WriteLine(); Console.WriteLine(string.Format("GcExcel benchmark for test-performance.xlsx which is 20.5MB with a lot of values, formulas and styles")); IWorkbook workbook = new Workbook(); Stopwatch watch = new Stopwatch(); watch.Start(); workbook.Open("../../files/test-performance.xlsx"); watch.Stop(); openTime = watch.ElapsedMilliseconds / 1000d; ; Console.WriteLine(string.Format("GcExcel open big Excel: {0:N3} s", openTime)); watch.Start(); workbook.Dirty(); workbook.Calculate(); watch.Stop(); calcTime = watch.ElapsedMilliseconds / 1000d; ; Console.WriteLine(string.Format("GcExcel calculate formulas for big Excel: {0:N3} s", calcTime)); watch.Start(); workbook.Save("../../output/gcexcel-saved-test-performance.xlsx"); watch.Stop(); saveTime = watch.ElapsedMilliseconds / 1000d; ; Console.WriteLine(string.Format("GcExcel save back to big Excel: {0:N3} s", saveTime)); }
다음 테스트에서는 100,000개 행 x 2개 열에 이중 값을 채운 다음 처음 2개 열에 인접해 있고 해당 열의 이중 값을 참조하는 100,000개 행 x 30개 열 범위에 수식을 설정하여 수식 설정, 계산, XLSX로 저장, 사용된 메모리 합계 등의 성능을 측정합니다.
이 테스트는 다음과 같습니다.
GcExcel 수식 성능 테스트
public static void TestSetRangeFormulas(int rowCount, int columnCount, ref double setTime, ref double calcTime, ref double saveTime, ref double usedMem) { Console.WriteLine(); Console.WriteLine(string.Format("GcExcel benchmark for double values with {0} rows and {1} columns", rowCount, columnCount)); IWorkbook workbook = new Workbook(); workbook.ReferenceStyle = ReferenceStyle.R1C1; IWorksheet worksheet = workbook.Worksheets[0]; double[,] values = new double[rowCount, 2]; for (int i = 0; i < rowCount; i++) { for (int j = 0; j < 2; j++) { values[i, j] = i + j; } } worksheet.Range[0, 0, rowCount, 2].Value = values; Stopwatch watch = new Stopwatch(); watch.Start(); worksheet.Range[0, 2, rowCount - 2, columnCount].Formula = "=SUM(RC[-2],RC[-1])"; watch.Stop(); setTime = watch.ElapsedMilliseconds / 1000d; ; Console.WriteLine(string.Format("GcExcel set formulas: {0:N3} s", setTime)); watch.Start(); workbook.Calculate(); watch.Stop(); calcTime = watch.ElapsedMilliseconds / 1000d; ; Console.WriteLine(string.Format("GcExcel calculates formula: {0:N3} s", calcTime)); workbook.ReferenceStyle = ReferenceStyle.A1; watch.Start(); workbook.Save("../../output/gcexcel-saved-formulas.xlsx"); watch.Stop(); saveTime = watch.ElapsedMilliseconds / 1000d; ; Console.WriteLine(string.Format("GcExcel save formulas to Excel: {0:N3} s", saveTime)); }
성능 결과
다음은 입니다.
GcExcel은 Excel 파일을 로드, 수정 및 저장하는 다양한 작업에서 다른 경쟁 제품보다 성능이 우수합니다. 아래 수치를 확인해 보십시오.
참고: 특정 시스템 구성에서 얻은 결과입니다. 다른 구성에서 실행하는 경우 GrapeCity에서 수집한 결과와 값이 정확히 일치하지 않을 수 있습니다. 전반적인 성능 상 불일치가 관찰되는 경우 댓글을 남겨 주시기 바랍니다.
또한 이전 빌드의 성능 비교 및 NPOI와 도 확인하시기 바랍니다.
지금 바로 GcExcel .NET Core를 다운로드하여 직접 테스트해보세요!
댓글목록
등록된 댓글이 없습니다.