Brad Fitzpatrick (bradfitz) wrote in lj_dev,
Brad Fitzpatrick
bradfitz
lj_dev

ljlib.pl trimming

Over time people keep adding crap to ljlib.pl and the time it takes to run a simple script which requires ljlib.pl keeps increasing.

Currently (on my dev machine), it takes 0.690 real seconds just to parse and load dependent modules from ljlib.pl. (this is after warming caches unti the number stabilizes)

I experimented with trimming ljlib.pl, removing non-core libraries:

Start:

real 0m0.690s

remove ljcom modules: geo::ip, cracklib, inline

real 0m0.652s

remove ljlib.pl modules: ljlang, poll, feed, links, cleanhtml, htmlcontrols

real 0m0.588s

remove mail stuff from ljlib: MIME::Lite and Text::Wrap

real 0m0.547s

remove phonepost (and thus Blob) from ljlib:

real 0m0.512s

remove paylib from ljcom:

real 0m0.329s

And this is all without moving any functions out of ljlib.pl. For instance, LJ::send_mail() could move to a new LJ::Mail package, and that package could also require Mime::Lite and Text::Wrap.

We did this a while back, but it's time to trim it all again. (scary, though)
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 3 comments