Re: Re: Any idea why we have two html_puts()'s?

From: Date: Sun, 12 May 2002 16:00:30 +0000
Subject: Re: Re: Any idea why we have two html_puts()'s?
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-83939@lists.php.net to get a copy of this message
> Ok, so I'll use your method. By the way, there was nothing inherent in the > two places you used 'inherent', on this topic :) php_html_puts is simple, consistent and easy to follow. These are its essential characteristics, and thus they are inherent. But I digress. > Again, I fail to understand the logic behind it. I'll change the space > handling code to your method (which is indeed nicer); Why on earth would > we need to have a stupid HTML printout function as a function pointer? If you would also address the two performance aspects I mentioned earlier, I would divert from my current stance that php_html_puts should be used further. Oh, wait and there is a third issue I did not think of earlier. Because zend_html_puts does not convert the whole string and calls ZEND_PUTC/_PUTS for each token, not only does that cause a TSRMLS_FETCH for every token, it also adds a jump over an indirect function pointer each time (zend_write). Thousands of such calls can easily add up and introduce a significant and in this case unnecessary overhead. php_html_puts can avoid this, because it knows about PHPWRITE and calls it only once per string, instead of a few dozen times. The last point cannot be easily addressed other than by supporting a redefinition of zend_html_puts by the application. - Sascha Experience IRCG http://schumann.cx/ http://schumann.cx/ircg

« previous php.dev (#83939) next »