SitePoint Sponsor

User Tag List

Results 1 to 10 of 10
  1. #1
    SitePoint Guru thr's Avatar
    Join Date
    Jun 2003
    Location
    Sweden
    Posts
    664
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    1k+ Objects and performance?

    Does anyone have any data at how the amount of objects created effects phps performance? If you start loading huge amounts of data (just in my simple testcases I load about 400 objects) (1000+ rows/objects) into php?

  2. #2
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Umm...

    With the afore mentioned Adjacency List script I posted in that thread, I noted no untoward performance lose with about 800 nodes, which related to 800 objects; One client using the script in question has about 1300 nodes in use at the moment, and they've yet to make any comments, complaints, perverse suggestions, etc in regards to performance.

    At the moment, they have about 60 odd people using that application most days, over the web it's self.

    That's 1300 or so objects, in relation just to the way their tree(s) are generated - not cached - on each page load, so not taking into account the other objects for that application.

    They have PHP5.0.3 on their dedicated server though, I suppose there is a notable difference between PHP4 <> PHP5?

  3. #3
    SitePoint Guru thr's Avatar
    Join Date
    Jun 2003
    Location
    Sweden
    Posts
    664
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok, thanks for that :] I'll try to make some benchmark with 1k+ objects myself.

  4. #4
    SitePoint Wizard Ren's Avatar
    Join Date
    Aug 2003
    Location
    UK
    Posts
    1,060
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have a CLI admin front end for something, that can create 5,000+ objects, (though not all at the same time). Nothing I've seen indicates there is a problem with PHP handling this.

  5. #5
    SitePoint Wizard silver trophy kyberfabrikken's Avatar
    Join Date
    Jun 2004
    Location
    Copenhagen, Denmark
    Posts
    6,157
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't think there are any other trouble than that of memory-usage. PHP's garbage collector generally does a good job.

  6. #6
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Off Topic:

    Does anyone know of a tool that will allow you to see the memory usage by PHP either in real time (I wish) or as a log? I don't mean the amount of time each statement consumes, but the amount of memory consumed on a per script basis...


    Sorry for going off topic everyone

  7. #7
    SitePoint Wizard Ren's Avatar
    Join Date
    Aug 2003
    Location
    UK
    Posts
    1,060
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Dr Livingston
    Off Topic:

    Does anyone know of a tool that will allow you to see the memory usage by PHP either in real time (I wish) or as a log? I don't mean the amount of time each statement consumes, but the amount of memory consumed on a per script basis...


    Sorry for going off topic everyone

    xdebug extension. Needs php compiled with some memory tracking option, but has functions for returning how much mem used, and the peak used.

    http://www.xdebug.org/docs-functions.php#tracing

  8. #8
    SitePoint Zealot
    Join Date
    Oct 2004
    Location
    Worcester
    Posts
    138
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Off Topic:

    Doesn't memory_get_usage() do that?

  9. #9
    SitePoint Zealot DerelictMan's Avatar
    Join Date
    Oct 2005
    Posts
    123
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by kyberfabrikken
    I don't think there are any other trouble than that of memory-usage. PHP's garbage collector generally does a good job.
    Generally, but unfortunately PHP lacks support for weak references. This can bite you when using an ORM and retrieving related objects. I have a somewhat long-running CLI script that uses Propel and by the time it's done it's really chewing up a ton of memory due to circular references not getting garbage collected...

  10. #10
    SitePoint Wizard stereofrog's Avatar
    Join Date
    Apr 2004
    Location
    germany
    Posts
    4,324
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by kyberfabrikken
    I don't think there are any other trouble than that of memory-usage. PHP's garbage collector generally does a good job.
    There is no such thing as "PHP's garbage collector"


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
  •