Fossil Forum

serhiy.storchaka 5 days, 21 hours ago

Post: wiki create --technote takes ~18 s on a large repository (cross join in wiki_technote_to_rid)

Creating a new technote runs the fallback query in wiki_technote_to_rid() (src/wiki.c), which has FROM event e, tag t, tagxref tx with t and tx unused, and an unparenthesized OR. On the Tk repository (8,020 tags, 113,485 tagxref rows) it takes 17.8 s (--sqltrace shows a negative vm-steps count). Dropping tag t, tagxref tx and parenthesizing the two IN terms gives the same lookup in about 10 ms. Present in 2.26, 2.28 and current trunk.

stephan 5 days, 3 hours ago

~18 s on a large repository...

Thank you for this and the other interesting finds. We will look into these and get back to you but it might take a few days. The pending SQLite 3.54 release currently has priority but your fossil ls --age report will be looked before the release - it's not yet clear whether the fix is in foci or sqlite.

stephan 5 days, 3 hours ago

wiki create --technote takes ~18 s

That's now checked in. Using Tcl's core repo for tests:

Before:

$ time f wiki create -t 2026-10-08T09:50:00Z "Testing technote create speed" /etc/hosts
^C

real    3m7.997s
user    3m1.477s
sys 0m6.447s

Note that ^C. Your 18s was fast!

After:

$ time f wiki create -t 2026-10-08T09:50:00Z "Testing technote create speed" /etc/hosts
Created new tech note 2026-10-08 09:50:00.

real    0m0.070s
user    0m0.033s
sys 0m0.022s
serhiy.storchaka 5 days, 1 hour ago

Thank you! Confirmed on the Tk repository: 28 s → 0.13 s.

One thing remains: each IN term got its own parentheses, so the OR still binds loosest, (type='e' AND ... AND IN1) OR IN2, and the sym- branch is not restricted to technotes. With a check-in tagged e.g. 2026-10-09T10:00:00Z and no technote at that time, fossil wiki commit -t 2026-10-09T10:00:00Z Note file picks the check-in and fails with "Internal error: Fossil tried to make an invalid artifact for the technote." instead of "no such tech note". Parenthesizing the OR as a whole fixes it:

-                      "                       WHERE tagname GLOB '%q')))"
-          "    OR (e.objid IN"
+                      "                       WHERE tagname GLOB '%q'))"
+          "    OR e.objid IN"

Z

serhiy.storchaka 5 days, 1 hour ago

BTW, I am creating a GUI for Fossil: Tktaalik, written in Tcl/Tk. These findings came up while I was testing it against Fossil 2.28. It is still at a very early stage, but it already supports most Fossil commands and options. This message was posted with the just-added posting feature. I would be glad to hear your feedback.

stephan 5 days, 1 hour ago

... sym- branch is not restricted to technotes.

Fixed, thank you!

serhiy.storchaka 5 days, 1 hour ago

Yest one simple test (will be removed).

serhiy.storchaka 5 days, 1 hour ago

Yet one simple test (edited, will be removed).

serhiy.storchaka 5 days, 1 hour ago

Delete reply: wiki create --technote takes ~18 s on a large repository (cross join in wiki_technote_to_rid)

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button