What is WebDNA

WebDNA is a scripting and database system designed to easily build web applications.

WebDNA and BioType

BioType service is a biometric keystroke dynamic system. It will be part of WebDNA 8.5

Download WebDNA

Download WebDNA freeware, try it and register later if you want.

WebDNA resources

The list of all WebDNA instructions.
WebDNA
Software Corporation
Search WebDNA Site
 Menu


HOME


DOWNLOADS


LEARN


EDUCATION


NEWS


COMMUNITY


STORE


SUPPORT


CONTACT

Removing [showif] makes a big difference in speed

This WebDNA talk-list message is from

1997


It keeps the original formatting.
numero = 10779
interpreted = N
texte = Hi Grant,The following HTML is supposed to lookup a record in the sum.db for a record with today's date. If it cannot find one, it creates a new one, and then it goes thru a time-consuming procedure (inside the [showif] context) which calculates a new value for the 'sum' field based on the search results and math calculations in another database, then it places that value into a newly-appended record in the sum.db.The whole idea is to make subsequent hits to this page run as if the [showif] stuff is not even there ... but that's not what happens. I was under the impression that this WebDNA would be slow only when the very first person of the day request the page ... because that's the only time the [search] and [math] and [append] would have to be performed ... because that's when the [showf] test would be 'true'. Every other hit of the day would return a [showif] test of 'false' which should skip all the enclosed WebDNA and go directly to the following [lookup] which is very fast.Unfortunately, it seems like WebCat2 performs the [search] and the [math] even when the enclosing [showif] test is evaluated as false.I'm not saying that WebCat2 is showing the results of this hidden activity, because it is *not*. WebCat2 is still delivering the results I would expect, but it takes just as long on subsequent hits as on the very first hit of the day - and that's what I thought I was avoiding with this code.In order to make sure the stuff inside the [showif] context was causing the slowdown, I removed the [showif] context and everything inside it just to see what difference it would make. The difference is like night and day! It takes at least 16-17 seconds with the [showif] stuff in the template, and only 0.083 seconds without it.Why does WebCat2 *not* skip directly to the end of the [showif] context when the test is false?[showif [lookup db=sum.db&value=[date]&lookInField=sumDate&returnField=sumDate¬Found=]![date] ] [append db=sum.db]sumDate=[date]&sum= [search db=agents.db&nepricedata=0] [math]([founditems][price]+[/founditems]0)/1000000[/math] [/search] [/append] [/showif][format thousands .1f] [lookup db=sum.db&value=[date]&lookInField=sumDate&returnField=sum¬Found=] [/format]Sincerely, Ken Associated Messages, from the most recent to the oldest:

    
  1. Re: Removing [showif] makes a big difference in speed (Grant Hulbert 1997)
  2. Follow-Up to: Removing [showif] makes a big difference in speed (Kenneth Grome 1997)
  3. Removing [showif] makes a big difference in speed (Kenneth Grome 1997)
Hi Grant,The following HTML is supposed to lookup a record in the sum.db for a record with today's date. If it cannot find one, it creates a new one, and then it goes thru a time-consuming procedure (inside the [showif] context) which calculates a new value for the 'sum' field based on the search results and math calculations in another database, then it places that value into a newly-appended record in the sum.db.The whole idea is to make subsequent hits to this page run as if the [showif] stuff is not even there ... but that's not what happens. I was under the impression that this WebDNA would be slow only when the very first person of the day request the page ... because that's the only time the [search] and [math] and [append] would have to be performed ... because that's when the [showf] test would be 'true'. Every other hit of the day would return a [showif] test of 'false' which should skip all the enclosed WebDNA and go directly to the following [lookup] which is very fast.Unfortunately, it seems like WebCat2 performs the [search] and the [math] even when the enclosing [showif] test is evaluated as false.I'm not saying that WebCat2 is showing the results of this hidden activity, because it is *not*. WebCat2 is still delivering the results I would expect, but it takes just as long on subsequent hits as on the very first hit of the day - and that's what I thought I was avoiding with this code.In order to make sure the stuff inside the [showif] context was causing the slowdown, I removed the [showif] context and everything inside it just to see what difference it would make. The difference is like night and day! It takes at least 16-17 seconds with the [showif] stuff in the template, and only 0.083 seconds without it.Why does WebCat2 *not* skip directly to the end of the [showif] context when the test is false?[showif [lookup db=sum.db&value=[date]&lookInField=sumDate&returnField=sumDate¬Found=]![date] ] [append db=sum.db]sumDate=[date]&sum= [search db=agents.db&nepricedata=0] [math]([founditems][price]+[/founditems]0)/1000000[/math] [/search] [/append] [/showif][format thousands .1f] [lookup db=sum.db&value=[date]&lookInField=sumDate&returnField=sum¬Found=] [/format]Sincerely, Ken Kenneth Grome

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

2.0 Info (1997) Cannot get subtotal to work (1997) Error Lob.db records error message not name (1997) WebCat2b12 - nesting [tags] (1997) Download (1999) 'does not contain' operator needed ... (1997) WebCat2b13MacPlugIn - [showif][search][/showif] (1997) WebCat2b12 - nesting [tags] (1997) 2.1 Stuff (1998) label?! (2005) IE4.5 bug FYI (1999) Email Format (1998) Re:Dumb Question about Docs (1997) Nesting FoundItem Context (1997) Possible Bug in 2.0b15.acgi (1997) The Form authentication trick (2000) WebCommerce: Folder organization ? (1997) Some Questions (1997) No Access warning when caching HTML files (1997) Re:2nd WebCatalog2 Feature Request (1996)