[TYPO3-core] RFC: devLog in t3lib_db

Dmitry Dulepov dmitry at typo3.org
Fri Dec 1 15:50:07 CET 2006


Michael Stucki wrote:
> I vote for trunk only. Either be strict in fixing bugs, or forget about it
> and change whatever we like...

I knew you will say that ;)

> - Style comment: Please add tabs in the function header.

Ok. Those were automatically generated by phpEclipse...

> - As mentioned before, I would prefer to use syslog instead of devlog.

Copying my reply from another thread: "I would favor syslog too but it 
does not accept data parameter and adding such thing as a message body 
would cause BE to load very slowly due to large amount of text 
information. So it will be nearly useless for *quick* diagnosing of the 
problem. devLog (especially Robert's file-based) can be installed 
quickly on demand and viewed with "more" and "tail", so I finally 
decided on devLog."

> - Could you please check if it's faster to call the function in any
>   situation, or wrap each call with an "if (FALSE !== $res) ..."

Do you mean
	if (false !== $res) {
		return myql_whatever($res);

It means we will have to copy the same piece of code (including string) 
to six places. I did that initially but than thought that we may want to 
isolate all checks inside one function (easier to extend and/or maintain 

I made with 100000 loops: function call takes ~0.15s (=0,0000015 per 
call) and "if (false != ...)" takes ~0.04s (0,0000004 per call). Even of 
we do 1000 calls to these functions per request, different will be 
0.001s. This is on my laptop with 800MHz CPU, so it will be even less 
different on a typical server. Nothing comparing to actual database call.

Dmitry Dulepov

Web: http://typo3bloke.net/
Skype: callto:liels_bugs

"It is our choices, that show what we truly are,
far more than our abilities." (A.P.W.B.D.)

More information about the TYPO3-team-core mailing list