Orvina.Engine
1.5.0
See the version list below for details.
dotnet add package Orvina.Engine --version 1.5.0
NuGet\Install-Package Orvina.Engine -Version 1.5.0
<PackageReference Include="Orvina.Engine" Version="1.5.0" />
paket add Orvina.Engine --version 1.5.0
#r "nuget: Orvina.Engine, 1.5.0"
// Install Orvina.Engine as a Cake Addin #addin nuget:?package=Orvina.Engine&version=1.5.0 // Install Orvina.Engine as a Cake Tool #tool nuget:?package=Orvina.Engine&version=1.5.0
Orvina
Introduction
This is a high performance text search application written in C#. Speed, ease of use, and robustness were all accounted for during the development of Orvina. This repository contains 2 projects:
Orvina.Console
- Console Application
- Builds the application for searching files for text
- The output will list the files containing the search text and show the lines of the file containing the search text
- Example usage:
orvina.exe "C:\my files" "search text" .cs,.js
- When the search completes, you may enter the (Id) of the file containing matching text to open it
Orvina.Engine
- Class Library available as a nuget package
- The only dependency of Orvina.Console
- Example usage:
using (var search = new Orvina.Engine.SearchEngine()) { search.OnError += Search_OnError; search.OnFileFound += Search_OnFileFound; search.OnSearchComplete += Search_OnSearchComplete; search.OnProgress += Search_OnProgress; search.Start(searchPath, includeSubdirectories, searchText, fileExtensions); //TODO //wait for the OnSearchComplete event before Disposing }
Under the hood
Orvina.Engine is multithreaded to build the result list as quickly as possible on your machine. While no amount of multithreading can fix a slow disk (I/O reads), care was taken to allow the disk to be as efficient as possible. This is achieved with a clever queuing and locking model that allows files streaming off of the disk to be promptly scanned.
Directory Thread
These are the first batch of threads that run and use the latest file enumerators available in .NET 6 that call directly into NTDLL.DLL. They recursively scan the root folder and its subfolders. While scanning the folder tree, it also tracks an shared list of files that have the desire file extension(s). Such as .cs or .js.
File Tractor
The file tractor leverages Asynchronous File I/O built into the OS. It allows file streaming from the disk to be stored as raw bytes in a memory queue. Any available threads will pull from this queue to scan the file for matching "search text".
Text Search Thread
Threads of this type will read the in-memory file byte stream. They read from the File Tractor queue and convert the byte stream to UTF8 text. The reads are synchronized such that only 1 thread may read a file at a time.
Notfification Thread
The notification thread no exists but it originally streamed output to the Console. The "-progress" flag can be used to view the search action. It was decided that having a dedicated thread for Console output was wasted CPU energy that would be better used in the search effort.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net6.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Massive performance increases over previous versions of Orvina. Bug fixes.