Skip to content

lukedays/excel-benchmarks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Excel Benchmarks

Gathering benchmarks for Excel add-ins. Inspired by The Benchmarks Game and some LinkedIn posts.

Featuring

Unfortunately I couldn't make a JavaScript addin to work. Suggestions welcome!

Benchmarks

Sum a 1.000 x 1.000 matrix (1 million cells)

Time in miliseconds:

Name Excel SUM(...) C++
(xlladdins)
C#
(Excel-DNA)
Python + Numpy
(xlOil)
Python + Numba
(xlOil)
Python Only
(xlOil)
VBA Python + Numpy
(xlwings)
Median 3.2 10.1 13.1 36.7 38.6 117.9 239.5 893.5

test1

How it works

I used the VBA code provided by Microsoft for performance measurement, in order to calculate the runtime of each cell with formulas. I changed it to run a 100 times in order to compute the statistics.

How to build (Windows only)

  • Download Visual Studio Community 2022 (free for personal use)
  • Install with .NET and C++ support
  • Install Python 3.10 (pyenv is a nice way to control versions)
  • Run the following commands in a terminal:
pip install xloil xlwings numba icc-rt cffi --upgrade
xlwings addin install
xloil install
  • Clone the repo. On the instructions below, ROOT will be the repo folder path.
  • Python - xlOil (has to be done before opening the workbook):
    • Open %APPDATA%\xlOil\xlOil.ini.
    • On the parameter PYTHONPATH, add ;ROOT\Python to the end
    • Change parameter: LoadModules=["xloil_addin"]
  • Open ROOT\Benchmarks.xlsm
  • C#:
    • Build CSharpAddin project with Release configuration.
    • Drag this file to Excel: ROOT\CSharp\bin\Release\net6.0-windows\CSharpAddin64.xll
  • C++:
    • Build CppAddin project with Release configuration.
    • Drag this file to Excel: ROOT\Cpp\x64\Release\CppAddin.xll
  • Python - xlwings:
    • On the xlwings tab inside Excel, add ROOT\Python to PYTHONPATH
    • On UDF Modules parameter, write xlwings_addin
    • Click Import Functions
  • Make sure the formulas for each framework work (yellow cells).
  • Click the button Run to compute the times

About

Benchmarks for Excel Formulas and Add-Ins

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published