The file access tests currently measures the speed for the following scenarios:
- List the contents of a folder with 10,000 files
- Read the content of those 10,000 files sequentially
- Read the content of those 10,000 files concurrently with a max of 100 files open at any given time to do not run out of file descriptors
The above tests are performed for files of 4Kb and 1MB.
The goal is to not block the UI so async/await is used in JS and C#. In the case of sequential read the code reads one file after another without blocking.
The tests for this are under the folder file-access
.
After clonning the repo make sure to install:
- Latest version of node
- Latest version of yarn 1.x
- Visual Studio 2019
- Latest version of WebView2
To run the Electron tests:
- Open a terminal into
file-access\electron\
. - Run
yarn
to install all dependencies - Run
yarn electron-forge make
to create the packaged version of the application - Run
out\electron-win32-x64\electron.exe
- Press the "start" button
- Once the challenge is finished, the text in the text area should change to "Done" and
files-access
should have the following 2 new files:
electron-1mb-results.csv
electron-4k-results.csv
To run the WebView2 tests:
- Open the solution
file-access\wpfwebview2\wpfwebview2.sln
- Install the nuget dependencies
- Build the solution in Release mode
- Close Visual Studio
- Run
file-access\wpfwebview2\bin\Release\netcoreapp3.1\wpfwebview2.exe
- Press the "start" button
- Once the challenge is finished, the text in the text area should change to "Done" and
files-access
should have the following 2 new files:
webview-1mb-results.csv
webview-4k-results.csv
The listing and reading with this technology is done in C#. Messages are sent from WebView to C# to tell what folder and file to read at each time. C# responds with the content of each action (files in the folder or contents of the file).
To run the WPF tests:
- Open the solution
file-access\wpf\wpf.sln
- Install the nuget dependencies
- Build the solution in Release mode
- Close Visual Studio
- Run
file-access\wpf\bin\Release\net5.0-windows\wpf.exe
- Press the "start" button
- Once the challenge is finished, the text in the text area should change to "Done" and
files-access
should have the following 2 new files:
wpf-1mb-results.csv
wpf-4k-results.csv