On 1/18/2010 4:52 PM, Jan Dubois wrote:
> On Mon, 18 Jan 2010, Michael Ellery wrote:
>>
>> I have a slow startup problem with a library I have written. The
>> observed behavior is that perl scripts that use my library
>> *intermittently* take 30 seconds to startup. If I run them again
>> immediately thereafter, they drop back down to about 10 seconds to
>> startup. If I wait for some time (several hours, perhaps, although I'm
>> not sure what the trigger is), then the script will exhibit slow startup
>> again for the first execution and behave normally thereafter. Rebooting
>> also causes the problem to reappear.
>
> Please try this patch to Win32::OLE::Const:
>
> http://code.google.com/p/libwin32/source/diff?spec=svn465&r=465&format=side&path=/trunk/Win32-OLE/lib/Win32/OLE/Const.pm
>
> It specifically deals with some slowness in Win32::OLE::Const that
> _may_ be the problem you are seeing.
>
> I guess I should make a Win32::OLE CPAN release to get this change
> out to the rest of the world.  So please confirm if this solves
> your problem!
>
> Cheers,
> -Jan
>
>

Jan,

Thanks for that patch. I've patched the file on my system and rebooted - 
now I see times shown below. Now my first startup time is only double my 
"steady state" time, which seems to be an improvement (previous run was 
more than 3 times the subsequent time). However, since the patch appears 
in a .pm file, shouldn't this change have an impact *every time* the 
script is executed, or is this code only loaded under certain conditions?

Thanks,
Mike


C:\s2>dprofpp tmon_FIRST.out
Total Elapsed Time = 20.19217 Seconds
   User+System Time = 2.898179 Seconds
Exclusive Times
%Time ExclSec CumulS #Calls sec/call Csec/c  Name
  75.2   2.181  2.173   1730   0.0013 0.0013  Win32::OLE::Dispatch
  8.11   0.235  0.326      2   0.1174 0.1628  Win32::OLE::Const::_Typelibs
  3.14   0.091  0.091    744   0.0001 0.0001  Win32::OLE::Const::_Typelib
  2.69   0.078  0.450     23   0.0034 0.0196  STRIDE::BEGIN
  1.55   0.045  0.041    796   0.0001 0.0001  Win32::OLE::DESTROY
  1.38   0.040  1.133   1729   0.0000 0.0007  Win32::OLE::AUTOLOAD
  1.10   0.032  0.032      2   0.0160 0.0160  Win32::OLE::new
  1.07   0.031  0.031      5   0.0062 0.0062  Devel::Symdump::_symdump
  1.07   0.031  0.541     39   0.0008 0.0139  STRIDE::Test::BEGIN
  0.55   0.016  0.016      1   0.0160 0.0160  Win32::OLE::bootstrap
  0.55   0.016  0.031      2   0.0080 0.0153  Pod::POM::parse_file
  0.55   0.016  0.016      8   0.0020 0.0020  DynaLoader::dl_load_file
  0.55   0.016  0.016      4   0.0040 0.0040  Config::BEGIN
  0.55   0.016  0.016     15   0.0011 0.0011  STRIDE::Test::MethodInfo::new
  0.55   0.016  0.016      5   0.0032 0.0032  Pod::POM::View::HTML::BEGIN

C:\s2>dprofpp tmon_SECOND.out
Total Elapsed Time = 10.09317 Seconds
   User+System Time = 2.742174 Seconds
Exclusive Times
%Time ExclSec CumulS #Calls sec/call Csec/c  Name
  74.9   2.056  2.064   1730   0.0012 0.0012  Win32::OLE::Dispatch
  9.63   0.264  0.342      2   0.1319 0.1708  Win32::OLE::Const::_Typelibs
  2.84   0.078  0.078    744   0.0001 0.0001  Win32::OLE::Const::_Typelib
  1.71   0.047  0.047      5   0.0094 0.0094  Devel::Symdump::_symdump
  1.68   0.046  0.419     23   0.0020 0.0182  STRIDE::BEGIN
  1.42   0.039  1.039   1729   0.0000 0.0006  Win32::OLE::AUTOLOAD
  1.17   0.032  0.527     39   0.0008 0.0135  STRIDE::Test::BEGIN
  1.13   0.031  0.031    269   0.0001 0.0001  Win32::OLE::Tie::Store
  0.58   0.016  0.016      2   0.0080 0.0080  Win32::OLE::new
  0.58   0.016  0.016      1   0.0160 0.0159  ActivePerl::Config::override
  0.58   0.016  0.031      5   0.0032 0.0061  Storable::BEGIN
  0.58   0.016  0.032      5   0.0032 0.0064  Win32::OLE::BEGIN
  0.58   0.016  0.557      4   0.0040 0.1394  main::BEGIN
  0.58   0.016  0.016     14   0.0011 0.0011 
STRIDE::Function::_perlFromPayload
  0.58   0.016  0.016     20   0.0008 0.0008  STRIDE::TestPoint::BEGIN

C:\s2>dprofpp tmon_THIRD.out
Total Elapsed Time = 10.09317 Seconds
   User+System Time = 2.775174 Seconds
Exclusive Times
%Time ExclSec CumulS #Calls sec/call Csec/c  Name
  77.0   2.137  2.129   1730   0.0012 0.0012  Win32::OLE::Dispatch
  8.94   0.248  0.326      2   0.1239 0.1628  Win32::OLE::Const::_Typelibs
  2.81   0.078  0.078    744   0.0001 0.0001  Win32::OLE::Const::_Typelib
  1.73   0.048  0.403     23   0.0021 0.0175  STRIDE::BEGIN
  1.69   0.047  0.047      5   0.0094 0.0094  Devel::Symdump::_symdump
  1.69   0.047  0.511     39   0.0012 0.0131  STRIDE::Test::BEGIN
  1.12   0.031  0.031      2   0.0155 0.0155  Win32::OLE::new
  1.01   0.028  0.963      3   0.0094 0.3209  STRIDE::TestPoint::Wait
  0.58   0.016  0.016      3   0.0053 0.0053  B::BEGIN
  0.58   0.016  0.016      5   0.0032 0.0032  base::BEGIN
  0.58   0.016  0.016      4   0.0040 0.0040  Pod::POM::Nodes::BEGIN
  0.58   0.016  0.031      5   0.0032 0.0061  Storable::BEGIN
  0.58   0.016  0.016     48   0.0003 0.0003  Pod::POM::Node::Sequence::new
  0.58   0.016  0.031     10   0.0016 0.0031 
STRIDE::Function::Constants::_getCurrentItem
  0.58   0.016  0.016    170   0.0001 0.0001  Pod::POM::Node::__ANON__




_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to