SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member RH-Yan's Avatar
    Join Date
    Jan 2008
    Posts
    24
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    PHP Websites with PECL C - High performance?

    C is a very fast language and PHP is decent performance wise. I was thinking writing a lot of my stuff in C and using PECL to communicate with PHP so it can be web based, to create scalable high performance websites. However, my concern was if this abstraction layer between the two languages is a large enough bottleneck where it is not even worth my time.

    I have never worked with PECL before so I apologize for my ignorance.

  2. #2
    SitePoint Wizard chris_fuel's Avatar
    Join Date
    May 2006
    Location
    Ventura, CA
    Posts
    2,750
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, the issue comes to maintainability as well. Sure you could do a lot of things using the PHP backend API, but how easy would it be to maintain. One of the nice things about PHP is that if done correctly, it's easy to maintain due to the relaxed nature of the language.

    C is incredibly strict compared to PHP. You have to deal with all sorts of fun things like "are my kernel headers compatible, can the compiler break my code, are my libraries the correct versions" and other fun questions.

    Now, if you were dealing with applications that might involve numbers crunching, yeah I would consider a C PHP extension to speed things up. Otherwise I'm just not sure the performance gain will outweigh the maintainable nature of C code.

  3. #3
    ********* Victim lastcraft's Avatar
    Join Date
    Apr 2003
    Location
    London
    Posts
    2,423
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Hi...

    What parts are you planning to write in C?

    yours, Marcus
    Marcus Baker
    Testing: SimpleTest, Cgreen, Fakemail
    Other: Phemto dependency injector
    Books: PHP in Action, 97 things


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
  •