SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Evangelist
    Join Date
    Mar 2006
    Posts
    466
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Large PHP Functions Include - Performance

    Hello,

    As I've been working on my latest project, I've found that my file that holds all my functions (functions.php) has grown and grown and grown. Now the file is almost up to 60Kb even though I've optimized it the best that I know how to at this point.

    My question is about performance.

    There are times when I include my functions.php file just use my little db1_connection() function which simply does this:

    PHP Code:
    mysql_connect(localhostuserpass);
    mysql_select_db(dbname) or die( "Unable to select database"); 
    I was just wondering if I would be better off busting my functions.php up into smaller pieces. 60Kb just seams like a large include.

    Brandon
    Home Recording Forum -
    Make 60% Commission Pushing my new mega system
    Killer Home Recording

  2. #2
    From space with love silver trophy
    SpacePhoenix's Avatar
    Join Date
    May 2007
    Location
    Poole, UK
    Posts
    5,068
    Mentioned
    103 Post(s)
    Tagged
    0 Thread(s)
    I don't know about performance wise but for finding functions, it may well pay to split it up, grouping the functions by the task they do, ie all database functions in a file of their own.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •