[Developers] Double quotes around keyword parameter values
Erik Schnetter
schnetter at aei.mpg.de
Thu Jun 2 09:41:11 CDT 2005
On Thursday 02 June 2005 12:59, Tom Goodale wrote:
> Ok, however WaveToyFreeF90 doesn't check in the inner loop, so this
> is a moot point.
Misunderstanding. This was about a modified version of WaveToyFreeF90,
in which I deliberately added an unnecessary check into the inner loop.
This was an experiment to measure the performance penalty of what
happens when someone is not aware of these string comparisons.
> Please return the check for double quotes in the CST that you
> removed, and enumerate the places where you think it is inconsistent.
With "inconsistent" I meant places that require double quotes and places
that don't. The only place that required quotes was the checking of
the default argument, which I changed. And if you look at the check as
it was, you'll have to admit that it looks weird -- the error message
complains that the keyword is not a string.
I think we should come up with a consistent design and document it, and
then emit warnings for all non-conforming cases. Currently, there are
the suggestions "require quotes always" and "require quotes for
keywords that contain spaces". Out of four interested people (TG, ES,
JT, and JT) I seem the only advocating non-quotes.
A slightly related issue are boolean parameters, where the values "yes"
and "no" etc. sound like keywords, but the values "1" and "0" do not.
It is also not clear whether quotes are required there.
> Future versions may use atoms and other tricks to make the
> comparisons faster, but this is not going to change in 4.0.
That is something that is in my opinion open to discussion. It's likely
that no one will implement this -- we haven't even agreed on a design
yet -- but if so, and if people found it useful, it should be discussed
whether it goes in.
> We
> should make sure that new users are made aware of the fact that
> string comparisons are slow. There was a case early in 4.0 when
> someone found a 400x speedup by moving the CCTK_Equals out of the
> inner loop !
-erik
--
Erik Schnetter <schnetter at aei.mpg.de> http://www.aei.mpg.de/~eschnett/
My email is as private as my paper mail. I therefore support encrypting
and signing email messages. Get my PGP key from www.keyserver.net.
More information about the Developers
mailing list