[TYPO3-core] RFC: #8515: Speed up tslib_cObj->getTreeList by caching its results

Oliver Klee typo3-german-02 at oliverklee.de
Mon May 26 13:46:59 CEST 2008


Hi Ingo,

Ingo Renner schrieb:
>> - Why is the cache cleared randomly? I think this will make testing a 
>> lot harder if this isn't deterministic.
> 
> If you would have read the description properly you should have noticed 
> that it is not random. The cache is cleared under those circumstances 
> that would alter the result.

I was referring to this piece of code:

+			// from time to time clean the cache from expired entries
+			// (theoretically every 1000 calls)
+		$randomNumber = rand(1, 1000);
+		if($randomNumber == 500) {
+			$this->removeExpiredCacheEntries();

If it shouldn't be random, why are you using rand() here?

>> - Please make all lines shorter than 80 characters (also the function declarations).
> 
> not for function declarations, other than that most lines are within the 80 chars

IIRC we decided that "all lines should be kept under 80 characters if at 
all possible". Do I remember this wrong?

>> - Please align the comments with the code:
>>
>>   // comment for the next code line
>>   code ...;
> 
> no, comments are indented with one tab as I did it.


IIRC we voted that the comments should be aligned with the code, not 
indented. Do I remember this wrong?

I think we really need to have the notes from the CGL session so we 
don't have to quote from memory.


Oliver


More information about the TYPO3-team-core mailing list