|
 |
Macrobyte Resources
Speed Testing the HTML Framework
There was quite a bit of discussion, on some of the Frontier mailing lists, about the benefits and drawbacks associated with bringing the HTMl framework scripts into the Frontier kernel.
On the Script Meridian, I offer the results of a series of tests run with different versions of Frontier, with and without the new kernel verbs. The script is available there as a fatpage, but many people still have problems with fatpages, especially Frontier 4 users.
To use this script, just copy and paste it into a script in any version of Frontier.
local (resultAdr = @workspace.WSTresults)
local (siteTable)
local (adrPageTable)
local (isFrontier5 = (frontier.version () beginsWith "5"))
if isFrontier5
adrPageTable = @websites.["#data"]
siteTable = @websites.samples.daveNet
else
siteTable = @user.websites.daveNet
local (p, comment = "")
if not dialog.confirm ("Performance-test with " + siteTable + "?")
return
dialog.ask ("Enter any notes for this test:", @comment)
html.init ()
on doTable (adrTable)
local (p, ct = sizeOf (adrTable^), adr)
for p = 1 to ct
adr = @adrTable^[p]
window.msg (adr)
if not html.traversalSkip (adr)
if typeOf (adr^) == tableType
doTable (adr)
else
if not isFrontier5
html.lockPageTable ()
try
if not isFrontier5
html.data.page.f = ""
html.data.page.fname = html.getFileName (nameOf (adr^))
local (s)
if isFrontier5
s = html.buildObject (adr, adrPageTable)
html.ftpText (s, adrPageTable)
else
s = html.buildObject (adr)
html.ftpText (s)
else
if not isFrontier5
log.add (clock.now () + " " + tryError + " " + string (adr), "htmlSuiteErrors")
if not isFrontier5
html.unlockPageTable ()
local (tx = clock.ticks ())
doTable (siteTable)
tx = clock.ticks () - tx
window.msg ("")
bundle
if not defined (resultAdr^)
new (wpTextType, resultAdr)
local (oldTarget = target.get ())
target.set (resultAdr)
wp.go (down, infinity); wp.go (right, infinity)
wp.insert ("\r")
wp.insert (string (clock.now ()) + cr)
wp.insert ("Rendered entire table: " + siteTable + " in " + (tx / 60) + " seconds " + (tx % 60) + " ticks." + cr)
wp.insert ("\tWith Frontier version " + file.getVersion (frontier.getProgramPath ()) + cr)
try
wp.insert ("\tRoot Update: " + workspace.newparts.notes.serialNum + cr)
if comment != ""
wp.insert ("\tNotes for this test:\r\t" + comment + cr)
target.set (oldTarget)
window.open (resultAdr)
|