From: Alex M. H. <amh...@on...> - 2010-08-09 15:08:26
|
John and Yaron, It sounds like there is some consensus that performance will likely not be an issue, so I think I'll used intro/default when I can--it is much easier to read the markup--and use #if when intro/default cannot handle the job. Thanks for your input and advice, Alex -- Alex M. Hendler ontolawgy(tm) LLC http://ontolawgy.com ------- Original message ------- From: "Yaron Koren" <ya...@gm...> To: "John Arrowwood" <Jo...@ir...> Cc: amh...@on..., "sem...@li..." <sem...@li...> Subject: Re: [Semediawiki-user] Performance of "#if:" vs. intro= default= Date: Monday, August 9, 2010 15:57:49 GMT+03:00 > Hi, > > I don't think #if results in its contents being called twice. I have no > idea > which approach would have the better performance, though - my guess is > that > the impact on performance either way would be small. > > -Yaron > > On Sun, Aug 8, 2010 at 6:42 PM, John Arrowwood <Jo...@ir...> wrote: > >> While I haven't looked at the code to be sure, I'd say that there is >> about >> a >> 99.9% chance that using the #if results in the query being run twice. >> On >> the bright side, MySQL probably cached it, so the second one is probably >> faster than it otherwise might be. >> >> However, in general, it is bad practice to do the #if approach for >> reasons >> that have nothing to do with speed. So my advice would be: don't do >> that. >> >> On Sun, Aug 8, 2010 at 10:05 AM, Alex M. Hendler >> <amh...@on...>wrote: >> >> > Hi, >> > >> > A few quick questions for the list: >> > >> > Is there any performance difference between using an #if: parser >> function >> > to determine if a query would have output and then running the query >> as >> > compared to using the built-in "intro" and "default" inline query >> > parameters? >> > >> > For example: >> > >> > Is this: >> > >> > {{#if: {{#ask: [[some property::{{PAGENAME}}]]}}| >> > ==Some Property== >> > {{#ask: [[some property::{{PAGENAME}} >> > |?Some other property >> > }}|''There is no "some property" value for {{PAGENAME}}'', but see >> {{#ask: >> > [[Some other property::{{PAGENAME}}]]}}}} >> > >> > substantially slower than this? >> > >> > {{#ask: [[some property::{{PAGENAME}}]] >> > |?Some other property >> > |intro=<h2>Some Property</h2> >> > |default=''There is no "some property" value for {{PAGENAME}}'', but >> see >> > {{#ask: [[Some other property::{{PAGENAME}}]]}} >> > }} >> > >> > I have not noticed any performance difference on a small test system, >> but >> > I am wondering how it would scale. My concern is this: If there is a >> query >> > result, does the #if: function is run the query twice (once to check >> if >> > the condition can be satisfied, and again to show the output)? If so, >> does >> > the intro/default method run the query only once in every case? (Or is >> the >> > converse true, or am I just completely wrong?) >> > >> > Any insight/feedback would be very much appreciated. >> > >> > Thanks, >> > Alex >> > -- >> > Alex M. Hendler >> > ontolawgy(tm) LLC >> > http://ontolawgy.com >> > >> > >> > >> ------------------------------------------------------------------------------ >> > This SF.net email is sponsored by >> > >> > Make an app they can't live without >> > Enter the BlackBerry Developer Challenge >> > http://p.sf.net/sfu/RIM-dev2dev >> > _______________________________________________ >> > Semediawiki-user mailing list >> > Sem...@li... >> > https://lists.sourceforge.net/lists/listinfo/semediawiki-user >> > >> >> >> >> -- >> John Arrowwood >> John (at) Irie (dash) Inc (dot) com >> John (at) Arrowwood Photography (dot) com >> John (at) Hanlons Razor (dot) com >> -- >> http://www.irie-inc.com/ >> http://arrowwood.blogspot.com/ >> >> ------------------------------------------------------------------------------ >> This SF.net email is sponsored by >> >> Make an app they can't live without >> Enter the BlackBerry Developer Challenge >> http://p.sf.net/sfu/RIM-dev2dev >> _______________________________________________ >> Semediawiki-user mailing list >> Sem...@li... >> https://lists.sourceforge.net/lists/listinfo/semediawiki-user |