From 5bf4df90566d83542d17c7d29edfe4584eb79db7 Mon Sep 17 00:00:00 2001 From: Sadeep Madurange Date: Thu, 23 Apr 2026 17:52:58 +0800 Subject: wip: Changed to journal and formatted search engine report. --- _config.yml | 2 +- _log/site-search.md | 51 ++++++++++++++++++++++++++++++++------------------- _log/vcs-1.md | 2 +- cgi-bin/find.cgi | 4 ++-- 4 files changed, 36 insertions(+), 23 deletions(-) diff --git a/_config.yml b/_config.yml index 3a2b528..a327ffb 100644 --- a/_config.yml +++ b/_config.yml @@ -1,4 +1,4 @@ -title: "Log" +title: "Journal" baseurl: "" # keep empty for root or subpath like /blog author: diff --git a/_log/site-search.md b/_log/site-search.md index b0b1d32..0848dce 100644 --- a/_log/site-search.md +++ b/_log/site-search.md @@ -1,5 +1,5 @@ --- -title: Search engine for static sites +title: Built a search engine for website based on suffix arrays date: 2026-01-03 layout: post --- @@ -63,29 +63,42 @@ Small seek/reads are fast on modern SSDs; keeps memory footprint small. Benchmarks on T490 (i7-10510U, OpenBSD 7.8, article size: 16 KB) against linear regex search: +
+=============================================================
+SEARCH BENCHMARK: Suffix array vs. Linear regex
+ARTICLE SIZE: 16 KB
+=============================================================
+
 500 files:
- - Index size: 204.94 KB 
- - Indexing time: 0.1475 s
- - Peak RAM (SA): 8828 KB
- - Peak RAM (Regex): 9136 KB
- - Search (SA): 0.0012 s
- - Search (Regex): 0.0407 s
+-------------------------------------------------------------
+METRIC          | SA                   | REGEX
+----------------+----------------------+---------------------
+Search time     |             0.0012s  |             0.0407s
+Peak RAM        |              8828 KB |              9136 KB
+Indexing time   |             0.1475s  |                 N/A
+Index size      |            204.94 KB |                 N/A
+-------------------------------------------------------------
 
 1,000 files:
- - Index size: 410.51 KB 
- - Indexing time: 0.3101 s
- - Peak RAM (SA): 8980 KB
- - Peak RAM (Regex): 9460 KB
- - Search (SA): 0.0019 s
- - Search (Regex): 0.0795 s
+-------------------------------------------------------------
+METRIC          | SA                   | REGEX
+----------------+----------------------+---------------------
+Search time     |             0.0019s  |             0.0795s
+Peak RAM        |              8980 KB |              9460 KB
+Indexing time   |             0.3101s  |                 N/A
+Index size      |            410.51 KB |                 N/A
+-------------------------------------------------------------
 
 10,000 files:
- - Index size: 4163.44 KB 
- - Indexing time: 10.9661 s
- - Peak RAM (SA): 12504 KB
- - Peak RAM (Regex): 12804 KB
- - Search (SA): 0.0161 s
- - Search (Regex): 0.9120 s
+-------------------------------------------------------------
+METRIC          | SA                   | REGEX
+----------------+----------------------+---------------------
+Search time     |             0.0161s  |             0.9120s
+Peak RAM        |             12504 KB |             12804 KB
+Indexing time   |            10.9661s  |                 N/A
+Index size      |           4163.44 KB |                 N/A
+-------------------------------------------------------------
+
Seek/read consistently outperformed mmap at <1k files. At 10k, mmap was occasionally faster (~200 µs), but used more memory—possibly OpenBSD's VM diff --git a/_log/vcs-1.md b/_log/vcs-1.md index c07d3bd..c0a7504 100644 --- a/_log/vcs-1.md +++ b/_log/vcs-1.md @@ -1,5 +1,5 @@ --- -title: Implemented experimental SSD-friendly VCS +title: Implemented an experimental SSD-friendly VCS date: 2026-04-23 layout: post --- diff --git a/cgi-bin/find.cgi b/cgi-bin/find.cgi index c30be69..9b1f913 100644 --- a/cgi-bin/find.cgi +++ b/cgi-bin/find.cgi @@ -208,12 +208,12 @@ sub render_html { - Log | Search + Journal | Search
-

Log

/ +

Journal

/

Search

-- cgit v1.2.3