Thanks,
As I said in the OP, I'm generally willing to trade speed for
clarity. I heavily use TCFs to support MVC style programming, so my
call stack is already pretty deep.
These guidelines are great, but I was hoping for some kind of
benchmarks, so I could get a sense of the potential for J2EE
compilation. From a standpoint of complete ignorance, it seems to me
that a J2EE app might optimize differently.
Viz., meta tags vs. actions. An action conceivably maps more or less
directly to byte-code, which is then further compiled at run-time.
OTOH, metatags in an action are more likely to be interpreted within
the witango Java library. If so, then it would justify my bias
toward action-oriented visual programming (which I like from the
maintenance standpoint), since I could then guesstimate the speed/
dollar trade-off.
Bill
On Mar 16, 2008, at 10:51 AM, Anthony M. Humphreys wrote:
Scott,
Well said. And quite correct.
Although I would have added a few:
~ Every action, even a group action, creates an object instance
internally within the server, which is overhead that slows the
execution.
~ Branching within a TAF is faster than branching outside the TAF;
both are faster than TCF Methods.
~ Many small TAF files are faster than one monolithic one with
many if actions.
~ The speed differences mean less on a fast server than on a slow
server.
~ Code optimized this way is a dog to maintain!
~ Often times, it is faster to get the Database to some of the
work for you than to do it in code, like calculations.
~ Lastly, there is often more speed to be gained from optimising
the Database than from optimising the code; use a fast Database
server on different machine than the Witango server, for instance,
and optimise the indexes.
As with all writing, is better to achieve clarity than concision.
Since the bulk of the lifetime of any code is not in the initial
writing, but in maintenance, you are better off writing code that
is descriptive and clear in its purpose than to write "fast" code
in almost all cases. Only in the most rare of cases does one truly
need to optimize code for speed.
Compiling to J2EE provides an opportunity to internally optimise
code and codes structures; I don't know what With has done on this
front, so you may need to roll up your sleeves and create a few
test cases.
Anthony -
----- Original Message -----
From: "Scott Cadillac" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Saturday, March 15, 2008 19:13
Subject: RE: Witango-Talk: relative speed
Hi Bill,
If speed is all a person is concerned about, with regards to
witango code, then:
~ Caching is faster than not caching.
~ NOT compiling to "Runtime only" is faster than compiled.
~ Metatags are faster than Actions.
~ TML files are faster than TAF files.
~ A TAF or TML with Includes is slower than a file without any
Includes.
~ Branches are faster than TCF Methods.
~ Lots of user scope variables are more expensive than lots of
local scope variables.
These things are contrary to managing your code in an optimum way
of course, but the reasoning can be summed up this way:
Most anything that makes a programmer's job easier, makes the code
run slower.
Compiling to J2EE is an entirely different question, because it's
no longer witango. Others can give you more advice with regards to
J2EE than me, but I suspect J2EE is generally faster than witango.
Hope that helps.
Scott,
On Saturday, March 15, 2008 7:33pm, William M Conlon
<[EMAIL PROTECTED]> said:
Has anyone run tests comparing the relative speed of a procedure when
implemented in actions as opposed to metatags in HTML Results?
I would be curious to see a comparison of these two approaches for:
Non-cached
cached
compiled.
To me, the action approach is more amenable to server-side speed-up,
especially when compiled for J2EE, but I would be curious to see the
difference. My bias has been to use actions for most things related
to business logic, because I think it is easier to have the logic
exposed when I crack open an old or unfamiliar file.
But there are some corner cases, where I could go either way. And
there are some frequently-called methods that I would like to
optimize for speed.
Bill
_____________________________________________________________________
___
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
______________________________________________________________________
__
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
______________________________________________________________________
__
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf