Re: Interesting speed comparison ..

This WebDNA talk-list message is from

2003


It keeps the original formatting.
numero = 54382
interpreted = N
texte = Having seen this, of course I had to download and install PHP on my dev machine and run the same tests ;) The php_speed.txt had a couple syntax errors, but after a couple quick changes it was running fine. I was up most of the night working on this ( thanks, Alain and Andrew ;) ) The 'text variables' test is definitely the culprit here. Creating a large number of WebDNA text variables early in the template, has a dramatic effect on ALL other WebDNA processing for the remainder of the template. A few reasons for this: 1. In most cases, WebDNA does not have a 'qualifier' to denote a text variable, like the '$' in php. The WebDNA parser has to query all outer context objects, asking each if it can identify a particular token. This does add more parsing overhead. I say 'in most cases', because you can access text variables using [text]mytextvar[/text], which will resolve a bit quicker, since the wrapping [text] identifies the inner content as a text variable. 2. The list object, used to store and retrieve text variables, is not optimized for speed. 3. Finally, and perhaps the biggest reason for the performance hit, is the order in which the WebDNA parser queries the outer context objects, when resolving a token. Many tokens, including context names and tag names, are run through the list of known text and math variables, before being identified as a context name or global WebDNA tag. So if the variable list is large, identification of context and tags is slowed down. I think on average, most WebDNA programmers will not create hundreds, or thousands, of text variables in one template. So they will not be impacted by the issues described above. For those that do, there are a few WebDNA 5.x features that can be used to help minimize the parsing overhead. The [Scope] context can be used to wrap sections of code that create and use several text variables, so that they are destroyed when the scope closes. A WebDNA array can be used to store a large number of values. A WebDNA function can be used to define code blocks that need to generate a large number of variables. Function calls are wrapped by an implied scope, so that variables created within the function are destroyed when the function is finished (unless the variables are created explicitly in the global name space or an outer scope). We do plan to address the second and third items, so that performance is fast even for very large variable lists. -----Original Message----- From: Alain Russell [mailto:alain.russell@blackpepper.co.nz] Sent: Thursday, November 20, 2003 6:53 PM To: WebDNA Talk Subject: Interesting speed comparison .. So Andrew has made a copy of the speed test in PHP .. Interesting results .. http://utility.blackpepper.co.nz/webdna_speed/php_speed.php http://utility.blackpepper.co.nz/webdna_speed/webdna_speed.html This is the same machine - Dual 2G G5, Dual HDD .. The source code is available for people that know PHP (You'll need to create a username/database etc) http://utility.blackpepper.co.nz/webdna_speed/php_speed.txt Any comment from SMSI on why variables/math etc are so much slower ?? Running v4.5.1 by the way .. Alain ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: Interesting speed comparison .. ( "Scott Anderson" 2003)
  2. Re: Interesting speed comparison .. ( Bob Minor 2003)
  3. Re: Interesting speed comparison .. ( "Scott Anderson" 2003)
  4. Re: Interesting speed comparison .. ( Jesse Proudman 2003)
  5. Re: Interesting speed comparison .. ( Alain Russell 2003)
  6. Re: Interesting speed comparison .. ( "Scott Anderson" 2003)
  7. Re: Interesting speed comparison .. ( Phillip Bonesteele 2003)
  8. Re: Interesting speed comparison .. ( Marc Kaiwi 2003)
  9. Interesting speed comparison .. ( Alain Russell 2003)
Having seen this, of course I had to download and install PHP on my dev machine and run the same tests ;) The php_speed.txt had a couple syntax errors, but after a couple quick changes it was running fine. I was up most of the night working on this ( thanks, Alain and Andrew ;) ) The 'text variables' test is definitely the culprit here. Creating a large number of WebDNA text variables early in the template, has a dramatic effect on ALL other WebDNA processing for the remainder of the template. A few reasons for this: 1. In most cases, WebDNA does not have a 'qualifier' to denote a text variable, like the '$' in php. The WebDNA parser has to query all outer context objects, asking each if it can identify a particular token. This does add more parsing overhead. I say 'in most cases', because you can access text variables using [text]mytextvar[/text], which will resolve a bit quicker, since the wrapping [text] identifies the inner content as a text variable. 2. The list object, used to store and retrieve text variables, is not optimized for speed. 3. Finally, and perhaps the biggest reason for the performance hit, is the order in which the WebDNA parser queries the outer context objects, when resolving a token. Many tokens, including context names and tag names, are run through the list of known text and math variables, before being identified as a context name or global WebDNA tag. So if the variable list is large, identification of context and tags is slowed down. I think on average, most WebDNA programmers will not create hundreds, or thousands, of text variables in one template. So they will not be impacted by the issues described above. For those that do, there are a few WebDNA 5.x features that can be used to help minimize the parsing overhead. The [scope] context can be used to wrap sections of code that create and use several text variables, so that they are destroyed when the scope closes. A WebDNA array can be used to store a large number of values. A WebDNA function can be used to define code blocks that need to generate a large number of variables. Function calls are wrapped by an implied scope, so that variables created within the function are destroyed when the function is finished (unless the variables are created explicitly in the global name space or an outer scope). We do plan to address the second and third items, so that performance is fast even for very large variable lists. -----Original Message----- From: Alain Russell [mailto:alain.russell@blackpepper.co.nz] Sent: Thursday, November 20, 2003 6:53 PM To: WebDNA Talk Subject: Interesting speed comparison .. So Andrew has made a copy of the speed test in PHP .. Interesting results .. http://utility.blackpepper.co.nz/webdna_speed/php_speed.php http://utility.blackpepper.co.nz/webdna_speed/webdna_speed.html This is the same machine - Dual 2G G5, Dual HDD .. The source code is available for people that know PHP (You'll need to create a username/database etc) http://utility.blackpepper.co.nz/webdna_speed/php_speed.txt Any comment from SMSI on why variables/math etc are so much slower ?? Running v4.5.1 by the way .. Alain ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ "Scott Anderson"

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:

Almost Real Time (2002) still having shipCost.db Problem (1997) Security Issues and WebCommerce Solution (1997) SSL and reg web*L and reg web* (1997) Multiple security dbs (1997) Hiding HTML and page breaks (1997) The old multiple selection bit (2000) docs for WebCatalog2 (1997) flushdatabases (1997) Search design (1997) Autoreturn Submit? (1997) Hosts who have upgraded to v5.0? (2003) NT [delete] (1998) PCS Frames (1997) cookies and [returnraw] (1997) WebCat2b15MacPlugin - showing [math] (1997) WebCatalog Beta Documentation (1997) WebCatalog2 Feature Feedback (1996) Disappearing records (2002) Just Testing (1997)