Re: cvs: php4 /ext/qtdom qtdom.c qtdom.h
| From: | Sterling Hughes | Date: | Thu, 16 Nov 2000 20:43:16 +0000 |
| Subject: | Re: cvs: php4 /ext/qtdom qtdom.c qtdom.h | ||
| References: | 1 2 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-2646@lists.php.net to get a copy of this message | ||
At 08:55 PM 11/16/2000 +0000, Bård Farstad wrote:
PHP simply because it fixes a single bug in a current working extension It's not fixing a bug. It's an alternative implementation using a more robust parser. Why are there both perl and POSIX extended regular expressions in PHP then? Probably so the user can choose which one to use.. ( okay, the perl regexps are better. But who am I to judge ? )I'll have to agree with you about Perl regex's.... There is still a fundamental difference, your missing the different classifications. POSIX regular expressions and Perl Compatible Regular Expressions (PCRE) have many differences, for one thing it is pretty much undisputed that Perl Compatible Regular Expressions are much faster than POSIX regular expressions. Secondly, and most importantly, PCRE is *different* than POSIX regular expressions, its not the same regular expression syntax with a different underlying engine. That would be closer to the situation with QtDOM and LibXML, they both provide the same interface and the same functionality (actually the current libxml extension provides more functionality such as creating xml documents).
at least not until every other option has been exhausted. Ok, then someone please fix the xmltree() function to parse valid XML documents. If noone can fix the parser I say the parser don't work and should not be a part of PHP:) Personally I don't have time to fix bugs in a XML parser.Are you saying libXML is broken??? I surely hope not, so it has a bug, I'd be willing to bet a large amount of money that QtDOM also has bugs, but I wouldn't go as far as to call them both broken (in fact I've never had a real problem using the current dom-xml functions).
Perhaps its an easy fix in libxml itself, perhaps you might be doing something wrong in the setup, and perhaps, your right, libxml currently does not support it, perhaps the next release of libxml will, then what? The user can still decide which to use. And that's the power of Open Source !Yes, just as much as you distributed as a separate extension. IMHO its not a good idea to distribute too many extensions that do exactly the same thing. However, once pear comes out (PHP Extension and Add-on Repository), this would be a good candidate for distribution there...
If QtDOM offered some signifigant new functionality, a much faster parser, or something else I could perhaps see the rationale in adding it, but as it is, I think it might be better to distribute QtDOM separately from PHP What about memory usage:The tests given have very little to do with memory usage, the size of a resulting structure has nothing to do with memory used by a program, take the following PHP Code: function make_array(&$ar) {
for ($i =0; $i < 100; $i++)
$ar[$i] = 1;
}
Are you saying that the above is slower than:
function make_array(&$ar)
{
$str = "HLKFKLLDFKDLWIOIFJE";
for ($i = 0; $i < 50; $i++) {
eregi("^34kkd$", $str);
$ar[$i] = $i;
}
}
They both do pretty much the same thing (fill $ar) except the second example puts less items into $ar therefore it must be faster, right?
Point:
The size of the resulting data structure is only one small factor when determining memory usage.-Sterling