Comparison Story: TextFinder

per-language walkthroughs of the same design, wired together for side-by-side reading

Comparison Story

These pages compare a single TextFinder design implemented in Rust, C++, C#, and Python. All four variants share the same three-component architecture (CommandLine, DirNav, Output) and command-line interface, so the differences show up in language idioms rather than design choices. Each language has its own thread — a six-page walkthrough that follows the same part order (Introduction, CmdLine, DirNav, Output, EntryPoint, Conclusion), so the reader can jump between languages at any part. Every page carries multi-language cross-links in its header for quick comparisons.

Language Threads

Language Entry page Status
Rust ComparisonStory_rs_textfinder_opt.html available
C++ ComparisonStory_CppTextFinder.html available
C# not yet written planned
Python not yet written planned
The threads above compare design and code — how each language expresses the same architecture in its own idioms. The tables that follow on this page compare the resulting implementations by size, complexity, and performance.

Performance

Timings over 20 warm-cache runs (first discarded), searching the NewSite root for class across source files. Median = average of the 10th and 11th sorted values.
TextFinder Files Visited Files Matched Min (s) Median (s) Max (s)
PyTextFinder 1196 656 0.222 0.281 0.715
EntryPointOpt 1196 656 0.536 0.610 1.034
CppTextFinder 1196 656 0.568 0.647 0.706
CsTextFinder 1196 656 0.827 1.053 1.456
EntryPoint 1196 656 0.873 0.905 1.402
All five agree on 656 matched files, confirming behavioral equivalence. Elevated max values for EntryPointOpt, CsTextFinder, and EntryPoint reflect OS scheduling interrupts during a run, not intrinsic tool cost — the medians are more representative of steady-state performance.

Code Metrics

Generated by code_metrics.py from the Projects directory. Lines = total line count (code + comments + blanks). Scopes = scope-opening tokens: { count for brace languages; lines ending with : for Python.
CppTextFinder
File Lines Scopes
CommandLine\src\CmdLine.ixx12629
CommandLine\src\test.cpp22579
DirNav\src\DirNav.ixx12619
DirNav\src\test.cpp49182
EntryPoint\src\main.cpp678
EntryPoint\src\test.cpp43559
generate_part.py33928
Output\src\Output.ixx11017
Output\src\test.cpp46970
TOTAL2388391
CsTextFinder
File Lines Scopes
CommandLine\CmdLine.cs9111
CommandLine\Test.cs5012
DirNav\DirNav.cs8716
DirNav\Test.cs18447
EntryPoint\Program.cs5714
EntryPoint\Test.cs13835
generate_part.py15914
Output\Output.cs6620
Output\Test.cs16637
TOTAL998206
PyTextFinder
File Lines Scopes
CommandLine\cmd_line.py9020
CommandLine\test_cmd_line.py7020
DirNav\dir_nav.py8023
DirNav\test_dir_nav.py15335
EntryPoint\PyTextFinder.py709
EntryPoint\test_main.py11535
generate_part.py15612
Output\output.py5720
Output\test_output.py11433
TOTAL905207
RsTextFinder
File Lines Scopes
RustCmdLine\examples\test1.rs4315
RustCmdLine\src\cmd_line_lib.rs24252
RustDirNav\examples\test1.rs7714
RustDirNav\src\dir_nav_lib.rs29453
EntryPoint\src\text_finder.rs29777
RustTfVerify\src\main.rs760137
TOTAL1715348
RsTextFinderOpt
File Lines Scopes
RustCmdLine\examples\test1.rs4315
RustCmdLine\src\cmd_line_lib.rs24352
RustDirNav\examples\test1.rs7714
RustDirNav\src\dir_nav_lib.rs29252
EntryPoint\src\text_finder.rs31978
RustTfVerify\src\main.rs760137
TOTAL1736348