Re: [cgiapp] size of scripts and dependencies
A bare Catalyst test app has about 87K lines. After you add all the plugins and support modules listed the tutorial (DBIx::Class, Template Toolkit, Session, Authentication, Authorization, FormFu) you're up to around 170K lines. Michael On Tue, 15 Sep 2009 11:10:31 -0500 P Kishor punk.k...@gmail.com wrote: Pursuant to the recent email about Titanium dependency hell, I was curious as to how big really was my tiny 20 line Perl index.cgi. So, with guidance from a couple of monks on PM, I add the following line to my script... END { system( 'wc', '-l', values %INC ) } and got the following (I have reverse sorted them by number of lines of code) 7824 /usr/local/lib/perl5/site_perl/5.8.8/darwin-2level/DBI.pm 3900 /usr/local/lib/perl5/site_perl/5.8.8/CGI/Simple.pm 2449 /usr/local/lib/perl5/site_perl/5.8.8/CGI/Application.pm 1535 /usr/local/lib/perl5/site_perl/5.8.8/Config/Simple.pm 1473 /usr/local/lib/perl5/site_perl/5.8.8/CGI/Session.pm 1472 /usr/local/lib/perl5/site_perl/5.8.8/darwin-2level/JSON/XS.pm 1434 /usr/local/lib/perl5/5.8.8/overload.pm 1299 /usr/local/lib/perl5/site_perl/5.8.8/CGI/Application/Dispatch.pm 1264 /usr/local/lib/perl5/5.8.8/darwin-2level/Data/Dumper.pm 891 /usr/local/lib/perl5/site_perl/5.8.8/Exception/Class.pm 872 /usr/local/lib/perl5/site_perl/5.8.8/darwin-2level/DBD/SQLite.pm 851 /Users/punkish/Sites/carbonmodel/app/_perl/Authen.pm 833 /usr/local/lib/perl5/5.8.8/darwin-2level/DynaLoader.pm 716 /usr/local/lib/perl5/site_perl/5.8.8/darwin-2level/Params/Validate.pm 614 /usr/local/lib/perl5/site_perl/5.8.8/CGI/Application/Plugin/LogDispatch.pm 604 /usr/local/lib/perl5/5.8.8/CGI/Carp.pm 566 /usr/local/lib/perl5/site_perl/5.8.8/Devel/StackTrace.pm 543 /usr/local/lib/perl5/site_perl/5.8.8/JSON/Any.pm 525 /usr/local/lib/perl5/site_perl/5.8.8/CGI/Application/Plugin/Session.pm 516 /usr/local/lib/perl5/5.8.8/darwin-2level/File/Spec/Unix.pm 497 /usr/local/lib/perl5/5.8.8/warnings.pm 456 /usr/local/lib/perl5/site_perl/5.8.8/CGI/Simple/Util.pm 446 /usr/local/lib/perl5/site_perl/5.8.8/Crypt/GeneratePassword.pm 440 /usr/local/lib/perl5/5.8.8/Exporter.pm 437 /usr/local/lib/perl5/site_perl/5.8.8/Log/Dispatch.pm 376 /usr/local/lib/perl5/5.8.8/darwin-2level/Digest/MD5.pm 356 /usr/local/lib/perl5/5.8.8/Time/Local.pm 356 /usr/local/lib/perl5/5.8.8/darwin-2level/XSLoader.pm 343 /usr/local/lib/perl5/5.8.8/AutoLoader.pm 340 /usr/local/lib/perl5/5.8.8/constant.pm 336 /usr/local/lib/perl5/5.8.8/darwin-2level/File/Spec.pm 327 /usr/local/lib/perl5/site_perl/5.8.8/Exception/Class/TryCatch.pm 316 /usr/local/lib/perl5/site_perl/5.8.8/CGI/Application/Plugin/DBH.pm 301 /usr/local/lib/perl5/site_perl/5.8.8/Log/Dispatch/Output.pm 283 /usr/local/lib/perl5/5.8.8/darwin-2level/Scalar/Util.pm 274 /usr/local/lib/perl5/site_perl/5.8.8/CGI/Application/Plugin/JSON.pm 274 /usr/local/lib/perl5/5.8.8/Carp.pm 263 /usr/local/lib/perl5/5.8.8/Text/ParseWords.pm 259 /usr/local/lib/perl5/site_perl/5.8.8/Log/Dispatch/File.pm 248 /usr/local/lib/perl5/5.8.8/Exporter/Heavy.pm 236 /usr/local/lib/perl5/5.8.8/darwin-2level/Fcntl.pm 235 /usr/local/lib/perl5/site_perl/5.8.8/CGI/Application/Plugin/Config/Simple.pm 233 /usr/local/lib/perl5/5.8.8/darwin-2level/List/Util.pm 226 /usr/local/lib/perl5/5.8.8/base.pm 214 /usr/local/lib/perl5/5.8.8/Class/ISA.pm 206 /usr/local/lib/perl5/5.8.8/darwin-2level/lib.pm 204 /usr/local/lib/perl5/site_perl/5.8.8/common/sense.pm 194 /usr/local/lib/perl5/site_perl/5.8.8/UNIVERSAL/require.pm 160 /usr/local/lib/perl5/site_perl/5.8.8/darwin-2level/Params/ValidateXS.pm 151 /usr/local/lib/perl5/site_perl/5.8.8/Class/Data/Inheritable.pm 147 /usr/local/lib/perl5/5.8.8/UNIVERSAL.pm 136 /usr/local/lib/perl5/5.8.8/strict.pm 131 /usr/local/lib/perl5/site_perl/5.8.8/Log/Dispatch/Screen.pm 127 /Users/punkish/Sites/carbonmodel/app/_perl/Carbonmodel.pm 100 /usr/local/lib/perl5/5.8.8/Digest/base.pm 95 /usr/local/lib/perl5/5.8.8/darwin-2level/Config.pm 93 /usr/local/lib/perl5/5.8.8/integer.pm 88 /usr/local/lib/perl5/5.8.8/bytes.pm 82 /usr/local/lib/perl5/5.8.8/vars.pm 73 /usr/local/lib/perl5/site_perl/5.8.8/CGI/Session/ErrorHandler.pm 63 /usr/local/lib/perl5/site_perl/5.8.8/Log/Dispatch/Base.pm 51 /usr/local/lib/perl5/5.8.8/warnings/register.pm 418 /usr/local/lib/perl5/5.8.8/attributes.pm 40 /usr/local/lib/perl5/5.8.8/locale.pm 23 /usr/local/lib/perl5/site_perl/5.8.8/auto/Config/Simple/autosplit.ix 13 /usr/local/lib/perl5/site_perl/5.8.8/auto/Config/Simple/verbose.al 40848 total So, 40K lines of code to create a fairly routine website, and that is not counting any HTML/SQL/JavaScript and CSS.
Re: [cgiapp] size of scripts and dependencies
On Fri, Sep 18, 2009 at 8:24 AM, Michael Graham ma...@the-wire.com wrote: A bare Catalyst test app has about 87K lines. After you add all the plugins and support modules listed the tutorial (DBIx::Class, Template Toolkit, Session, Authentication, Authorization, FormFu) you're up to around 170K lines. Cool! So, I am convinced that CGI::App and its bundle of plug-ins is rather svelte compared to, say, Catalyst. But, now that we are done comparing our overweight weight to a morbidly obese weight, how about CGI::App on its own? To my completely uninformed mind, loading 40,000+ lines to create a small web page sounds like a lot... and, that doesn't even include the web server and the Perl interpreter! The other related issue is a single-piece install vs. lots of bits and bobs. While the latter provides fine-grained control over what one wants, lots of moving parts means lots of places things can go wrong. I guess Titanium is a move toward that perception model of a single-piece install, but Titanium is just a very thin skin holding a lot of jingling jangling bones together. Of course, a single-piece installation will presume certain scaffolding for people, whether they like it or not, and provide certain built-in ways of doing things, but if those ways meet the needs of 80% of the people in an easy, single-click installation, one piece to understand way, heck, we have 80% of customers as happy customers, as happy spokespersons, etc. One way to achieve this would be to simply squish all the various bits and bobs into a single file and called CGI::Mongo. It will still be 40,000+ lines long, but heck, it would be a single file that will be 40,000+ lines long. The Perl interpreter will have to open only one file on every invocation. Then, one can work on trimming what one doesn't need. Michael On Tue, 15 Sep 2009 11:10:31 -0500 P Kishor punk.k...@gmail.com wrote: Pursuant to the recent email about Titanium dependency hell, I was curious as to how big really was my tiny 20 line Perl index.cgi. So, with guidance from a couple of monks on PM, I add the following line to my script... END { system( 'wc', '-l', values %INC ) } and got the following (I have reverse sorted them by number of lines of code) 7824 /usr/local/lib/perl5/site_perl/5.8.8/darwin-2level/DBI.pm 3900 /usr/local/lib/perl5/site_perl/5.8.8/CGI/Simple.pm 2449 /usr/local/lib/perl5/site_perl/5.8.8/CGI/Application.pm 1535 /usr/local/lib/perl5/site_perl/5.8.8/Config/Simple.pm 1473 /usr/local/lib/perl5/site_perl/5.8.8/CGI/Session.pm 1472 /usr/local/lib/perl5/site_perl/5.8.8/darwin-2level/JSON/XS.pm 1434 /usr/local/lib/perl5/5.8.8/overload.pm 1299 /usr/local/lib/perl5/site_perl/5.8.8/CGI/Application/Dispatch.pm 1264 /usr/local/lib/perl5/5.8.8/darwin-2level/Data/Dumper.pm 891 /usr/local/lib/perl5/site_perl/5.8.8/Exception/Class.pm 872 /usr/local/lib/perl5/site_perl/5.8.8/darwin-2level/DBD/SQLite.pm 851 /Users/punkish/Sites/carbonmodel/app/_perl/Authen.pm 833 /usr/local/lib/perl5/5.8.8/darwin-2level/DynaLoader.pm 716 /usr/local/lib/perl5/site_perl/5.8.8/darwin-2level/Params/Validate.pm 614 /usr/local/lib/perl5/site_perl/5.8.8/CGI/Application/Plugin/LogDispatch.pm 604 /usr/local/lib/perl5/5.8.8/CGI/Carp.pm 566 /usr/local/lib/perl5/site_perl/5.8.8/Devel/StackTrace.pm 543 /usr/local/lib/perl5/site_perl/5.8.8/JSON/Any.pm 525 /usr/local/lib/perl5/site_perl/5.8.8/CGI/Application/Plugin/Session.pm 516 /usr/local/lib/perl5/5.8.8/darwin-2level/File/Spec/Unix.pm 497 /usr/local/lib/perl5/5.8.8/warnings.pm 456 /usr/local/lib/perl5/site_perl/5.8.8/CGI/Simple/Util.pm 446 /usr/local/lib/perl5/site_perl/5.8.8/Crypt/GeneratePassword.pm 440 /usr/local/lib/perl5/5.8.8/Exporter.pm 437 /usr/local/lib/perl5/site_perl/5.8.8/Log/Dispatch.pm 376 /usr/local/lib/perl5/5.8.8/darwin-2level/Digest/MD5.pm 356 /usr/local/lib/perl5/5.8.8/Time/Local.pm 356 /usr/local/lib/perl5/5.8.8/darwin-2level/XSLoader.pm 343 /usr/local/lib/perl5/5.8.8/AutoLoader.pm 340 /usr/local/lib/perl5/5.8.8/constant.pm 336 /usr/local/lib/perl5/5.8.8/darwin-2level/File/Spec.pm 327 /usr/local/lib/perl5/site_perl/5.8.8/Exception/Class/TryCatch.pm 316 /usr/local/lib/perl5/site_perl/5.8.8/CGI/Application/Plugin/DBH.pm 301 /usr/local/lib/perl5/site_perl/5.8.8/Log/Dispatch/Output.pm 283 /usr/local/lib/perl5/5.8.8/darwin-2level/Scalar/Util.pm 274 /usr/local/lib/perl5/site_perl/5.8.8/CGI/Application/Plugin/JSON.pm 274 /usr/local/lib/perl5/5.8.8/Carp.pm 263 /usr/local/lib/perl5/5.8.8/Text/ParseWords.pm 259 /usr/local/lib/perl5/site_perl/5.8.8/Log/Dispatch/File.pm 248 /usr/local/lib/perl5/5.8.8/Exporter/Heavy.pm 236 /usr/local/lib/perl5/5.8.8/darwin-2level/Fcntl.pm 235 /usr/local/lib/perl5/site_perl/5.8.8/CGI/Application/Plugin/Config/Simple.pm
Re: [cgiapp] size of scripts and dependencies
On 09/18/2009 09:33 AM, P Kishor wrote: But, now that we are done comparing our overweight weight to a morbidly obese weight, how about CGI::App on its own? To my completely uninformed mind, loading 40,000+ lines to create a small web page sounds like a lot... and, that doesn't even include the web server and the Perl interpreter! But that's not what you tested. You tested Titanium which is not CGI::App. It's an opinionated framework based on CGI::App and it's plugins. If you just want to create something that makes small web pages then just load CGI::App and it's dependencies. Also, let's look at those numbers: DBI - 7824 CGI::Simple - 3900 That's 1/4 of all those lines just right there. And if you're going to use a database you need DBI. And if you're going to make a web app you need a CGI interface module (like CGI.pm or CGI::Simple) so I don't see a way to remove those. Also, you're counting just raw lines which means you're counting comments and whitespace (which penalizes modules which are well commented). I'm not saying your criticism isn't valid, I'm just saying that your data is too flawed to support that criticism :) -- Michael Peters Plus Three, LP # CGI::Application community mailing list #### ## To unsubscribe, or change your message delivery options, ## ## visit: http://www.erlbaum.net/mailman/listinfo/cgiapp## #### ## Web archive: http://www.erlbaum.net/pipermail/cgiapp/ ## ## Wiki: http://cgiapp.erlbaum.net/ ## ####
Re: [cgiapp] size of scripts and dependencies
Very good points Michael. My response to some of them below -- On Fri, Sep 18, 2009 at 8:47 AM, Michael Peters mpet...@plusthree.com wrote: On 09/18/2009 09:33 AM, P Kishor wrote: But, now that we are done comparing our overweight weight to a morbidly obese weight, how about CGI::App on its own? To my completely uninformed mind, loading 40,000+ lines to create a small web page sounds like a lot... and, that doesn't even include the web server and the Perl interpreter! But that's not what you tested. You tested Titanium which is not CGI::App. It's an opinionated framework based on CGI::App and it's plugins. If you just want to create something that makes small web pages then just load CGI::App and it's dependencies. Actually, I did not test Titanium (I only invoked it as an example). I tested my own application that is cobbled together with the various bits and bobs of CGI::App and various plugins. Also, let's look at those numbers: DBI - 7824 CGI::Simple - 3900 That's 1/4 of all those lines just right there. And if you're going to use a database you need DBI. And if you're going to make a web app you need a CGI interface module (like CGI.pm or CGI::Simple) so I don't see a way to remove those. I guess that is what I was trying to get at... one of the things that many Perl modules (and CGI::App as well) make a big deal about is how simple scripts are once you use those modules... for example, the oft quoted example of WebApp.pm and instance script being only a couple of lines. Well, in reality, all the plumbing is still there, just under a carpet. Also, you're counting just raw lines which means you're counting comments and whitespace (which penalizes modules which are well commented). I'm not saying your criticism isn't valid, I'm just saying that your data is too flawed to support that criticism :) Yes, my data are too flawed, but the criticism is still valid. But, instead of kvetching in the wind, I will actually try an experiment. I will remove all the comments from the modules that I am using (call them the production versions, analogous to the packed/minified Javascript packages floating around), and even try to squish them into one file. I am curious as to what I end up with. Nevertheless, thanks for indulging with me in this argument. Your points are very valid. -- Michael Peters Plus Three, LP # CGI::Application community mailing list ## ## ## To unsubscribe, or change your message delivery options, ## ## visit: http://www.erlbaum.net/mailman/listinfo/cgiapp ## ## ## ## Web archive: http://www.erlbaum.net/pipermail/cgiapp/ ## ## Wiki: http://cgiapp.erlbaum.net/ ## ## ## -- Puneet Kishor http://www.punkish.org Carbon Model http://carbonmodel.org Charter Member, Open Source Geospatial Foundation http://www.osgeo.org Science Commons Fellow, http://sciencecommons.org/about/whoweare/kishor Nelson Institute, UW-Madison http://www.nelson.wisc.edu --- Assertions are politics; backing up assertions with evidence is science === Sent from Madison, WI, United States # CGI::Application community mailing list #### ## To unsubscribe, or change your message delivery options, ## ## visit: http://www.erlbaum.net/mailman/listinfo/cgiapp## #### ## Web archive: http://www.erlbaum.net/pipermail/cgiapp/ ## ## Wiki: http://cgiapp.erlbaum.net/ ## ####