[PHP4BETA] 1024 small classes and a lot of time...
| From: | Kristian Köhntopp | Date: | Fri, 09 Apr 1999 12:45:42 +0000 |
| Subject: | [PHP4BETA] 1024 small classes and a lot of time... | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-49@lists.php.net to get a copy of this message | ||
This little thingie takes more time to stop than to start, i.e.
after "I am class 1023" I have to wait for 10 seconds or so to
see the prompt again. That's because my machine swaps itself to
death: 94M memory usage, 43M resident set size.
I admit that this is an unfair benchmark, but then I am a beta
tester.
Kristian
kk@poe /tmp/y $ cat bla.pl
#! /opt/bin/perl --
$stop = 1024;
print "<?php\n";
for ($i=0; $i<$stop; $i++) {
print qq(
class c$i {
var \$slot1;
var \$slot2 = $i;
function f() {
printf("I am class %s\\n", \$this->slot2);
}
}
);
}
for ($i=0; $i<$stop; $i++) {
print qq(
\$a[\$i] = new c$i;
\$a[\$i]->f();
);
}
print "\n?>\n";
kk@poe /tmp/y $ perl bla.pl > p.out
kk@poe /tmp/y $ time ~kk/php4/php p.out > /dev/null
kk@poe /tmp/y $ time ~kk/php4/php p.out > /dev/null
real 1m16.957s
user 0m4.443s
sys 0m12.251s
PID USERNAME PRI NICE SIZE RES STATE TIME WCPU CPU
COMMAND
25774 kk 35 0 94M 43M sleep 0:15 17.63% 15.18%
php
--
Kristian Köhntopp, NetUSE Kommunikationstechnologie GmbH
Siemenswall, D-24107 Kiel, Germany, +49 431 386 436 00
Using PHP3? See our web development library at
http://phplib.shonline.de/ (GPL)
--
PHP 4 Beta