adapting to CreateInstancebyContractID() perf improvement

This commit is contained in:
dp%netscape.com 2001-08-21 19:07:26 +00:00
Родитель fc6705b321
Коммит 3b887dad3f
1 изменённых файлов: 20 добавлений и 6 удалений

Просмотреть файл

@ -25,20 +25,21 @@ use strict;
sub getContractID($);
sub sum($);
# Configuration parameters
# Print all ?
my $all = 0;
# hash of cid -> contractid
my %contractid;
my %contractid_n;
my %failedContractid_n;
# count of instances of objects created
my (%objs, %failedObjs) = ();
my (%objs, %objs_contractid, %failedObjs) = ();
# dlls loaded
my @dlls;
# Print all ?
my $all = 0;
# temporaries
my ($cid, $n, $str);
@ -70,6 +71,12 @@ while (<>) {
next;
}
# CreateInstanceByContractID()
if (/CreateInstanceByContractID\((.*)\) succeeded/) {
$objs_contractid{$1}++;
next;
}
# FAILED CreateInstance()
if (/CreateInstance\(\{(.*)\}\) FAILED/) {
$failedObjs{$1}++;
@ -77,7 +84,6 @@ while (<>) {
}
}
# if there is a file named reg.out in the current dir
# then use that to fill in the ContractIDToClassID mapping.
my $REG;
@ -105,7 +111,7 @@ for ($n = 0; $n < scalar @dlls; $n++) {
print "\n";
# Objects created
print "Object creations [", sum(\%objs), "]\n";
print "Object creations from CID [", sum(\%objs), "]\n";
print "----------------------------------------------------------------------\n";
foreach $cid (sort {$objs{$b} <=> $objs{$a} } keys %objs) {
last if (!$all && $objs{$cid} < 50);
@ -113,6 +119,14 @@ foreach $cid (sort {$objs{$b} <=> $objs{$a} } keys %objs) {
}
print "\n";
print "Object creations from ContractID [", sum(\%objs_contractid), "]\n";
print "----------------------------------------------------------------------\n";
foreach $cid (sort {$objs_contractid{$b} <=> $objs_contractid{$a} } keys %objs_contractid) {
last if (!$all && $objs_contractid{$cid} < 50);
printf "%5d. %s - %s\n", $objs_contractid{$cid}, $cid, getContractID($cid);
}
print "\n";
# FAILED Objects created
print "FAILED Objects creations [", sum(\%failedObjs), "]\n";
print "----------------------------------------------------------------------\n";