From 4f49b16079b27d7ce633619e4cddfdf2bffbc952 Mon Sep 17 00:00:00 2001 From: cashmere Date: Fri, 4 Sep 2026 09:05:24 +0200 Subject: initial commit --- test/many-www.tcl | 81 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 test/many-www.tcl (limited to 'test/many-www.tcl') diff --git a/test/many-www.tcl b/test/many-www.tcl new file mode 100644 index 0000000..414b1c7 --- /dev/null +++ b/test/many-www.tcl @@ -0,0 +1,81 @@ +#!/usr/bin/tclsh +# +# Run this script from within any open Fossil checkout. Example: +# +# tclsh many-www.tcl | tee out.txt +# +# About 10,000 different web page requests will be made. Each is timed +# and the time shown on output. Use this script to search for segfault problems +# or to look for pages that need optimization. +# +proc run_query {url} { + set fd [open q.txt w] + puts $fd "GET $url HTTP/1.0\r\n\r" + close $fd + return [exec fossil test-http 1000000} { + set x [string range $x 0 1000000] + } + set k 0 + while {[regexp {<[aA] .*?href="(/[a-z].*?)".*?>(.*)$} $x all url tail]} { + # if {$npending>2*($limit - $i)} break + incr k + if {$k>100} break + set u2 [string map {< < > > " \" & &} $url] + if {![info exists seen($u2)]} { + set next($u2) 1 + set seen($u2) 1 + } + set x $tail + } +} -- cgit v1.3.1