ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> pdk
pdk
Re: PerlApp slow compared to running from source
by Foo JH other posts by this author
Jun 22 2009 1:39AM messages near this date
PerlApp slow compared to running from source | RE: PerlApp slow compared to running from source
Same problem here. I'm packaging a wxPerl app, and the packaged binary
is usually about 4-5sec for the first run. Subsequent runs (without
rebooting Windows) are usually faster.

I would think this is the result of the executable unpacking the .exe
into the actual Perl components?



Michael Herger wrote:
>  Hi!
>  
>  Part of our software suite is a PerlApp packaged GUI application (using  
>  Wx). Due the used library the resulting file is rather large (~9MB).
>  
>  As we've had some complaints about slow startup, I've done some testing.  
>  In order to give an early visual feedback to the user, I've added a splash  
>  screen as early in the code as possible (simplified code):
>  
>  #!/usr/bin/perl
>  
>  require 5.008_001;
>  
>  use strict;
>  use File::Path;
>  use File::Spec::Functions;
>  
>  use Time::HiRes qw(time);
>  my $x = time();
>  
>  # don't use Wx, if script is run using perl on OSX, it needs to be run  
>  using wxperl
>  my $splash;
>  my $useWx = ($^O !~ /darwin/ || $^X =~ /wxPerl/i) && eval {
>      require Wx;
>  
>      Wx::Image::AddHandler(Wx::ICOHandler->new());
>      my $bitmap = Wx::Bitmap->new($'SqueezeCenter.ico',  
>  Wx::wxBITMAP_TYPE_ICO());
>      if ($bitmap) {
>         $splash = Wx::SplashScreen->new($bitmap);
>      }
>  
>      require Wx::Event;
>      require Slim::GUI::ControlPanel;
>  }
>  
>  print time() - $x;
>  ...
>  
>  Running this code from the source will give me the splash screen within a  
>  fraction of a second. Running the .exe file would take several seconds to  
>  get it shown. No matter whether I'm using any of the nocompress, clean or  
>  dyndll options. The simple timing ($x) would result in an approximately  
>  50% longer runtime for the $useWx evaluation.
>  
>  Is this performance hit to be expected? Is there anything I can do to get  
>  the startup performance closer to the one running from source?
>  
>  Full code can be found here:
>  http://svn.slimdevices.com/slim/7.4/trunk/server/cleanup.pl
>  (please note that the splash screen is not checked in, but was only added  
>  locally to test with)
>  
>  Executables:
>  http://downloads.slimdevices.com/nightly/?ver=7.4
>  
>  Regards,
>  

_______________________________________________
PDK mailing list
PDK@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Thread:
Michael Herger
Foo JH
Jan Dubois
Michael Herger
Michael Herger
Jan Dubois
Foo JH
Michael Herger
Jan Dubois

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved