[development] some performance notes

Larry Garfield larry at garfieldtech.com
Sat Dec 10 17:56:26 UTC 2005


I agree that, whenever possible, a value's type should be known and assumed 
correct.  Anything else is a bug.  Of course, I also believe that a value's 
NULL status should always be known, and known to not be. :-)  

If we can ensure that possibly-NULL values get a standard false value (0 for 
ints, '' for strings) that makes achieving E_ALL compliance much easier, and 
the code much cleaner.  (The only time isset() should be necessary is if the 
value being tested is a parameter to the same function where the isset() is, 
and when a non-NULL default value can't be used.)

On Friday 09 December 2005 06:19 pm, Chris Johnson wrote:
> This review / performance improvement is well under way.
>
> I've noticed that we could completely delete a lot of is_array() calls if
> we simply defined the argument as an array only.  It is either an array, or
> it isn't.  The caller should wrap the single element in array() if need be.
>
> What are other opinions?
>
> I'll fix them if we agree that's the right way to go.
>
>
> ..chrisxj

-- 
Larry Garfield			AIM: LOLG42
larry at garfieldtech.com		ICQ: 6817012

"If nature has made any one thing less susceptible than all others of 
exclusive property, it is the action of the thinking power called an idea, 
which an individual may exclusively possess as long as he keeps it to 
himself; but the moment it is divulged, it forces itself into the possession 
of every one, and the receiver cannot dispossess himself of it."  -- Thomas 
Jefferson


More information about the development mailing list