DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
  1. DZone
  2. Coding
  3. Languages
  4. Speed Up Your PHP Like Facebook

Speed Up Your PHP Like Facebook

John Esposito user avatar by
John Esposito
·
Nov. 28, 11 · Interview
Like (0)
Save
Tweet
Share
9.99K Views

Join the DZone community and get the full member experience.

Join For Free

Facebook works well. NoSQL received a huge boost when people learned that Facebook uses Cassandra. But how much do people care that Facebook uses PHP?

Not just any PHP -- they 'rewrote the compiler', or rather wrote a translator that converts PHP into C++, then compiles with g++.

But Facebook did more for PHP: they also created XHProf, a PHP profiler with a (supposedly) easy-to-use HTML interface, designed to pinpoint exactly where your bottlenecks are appearing, so that you can optimize at every stage in the pipeline. Here's how the github readme describes it:

XHProf is a function-level hierarchical profiler for PHP and has a simple HTML based user interface. The raw data collection component is implemented in C (as a PHP extension). The reporting/UI layer is all in PHP. It is capable of reporting function-level call counts and inclusive and exclusive wall time, CPU time and memory usage. Additionally, it supports ability to compare two runs (hierarchical DIFF reports), or aggregate results from multiple runs.


If you haven't tried XHProf, you might want to look into it. Installation apparently requires a little nudging, but Nick Lewis just posted a full, practical guide to benchmarking and performance tuning your PHP and MySQL, using XHProf (as well as other techniques) -- a very nice overview of many common bottlenecks and how to open them up.

Nick also links to a great Drupal 6 performance wiki (no complaints now, plenty of users are still on Drupal 6), which is helpfully divided into subsections (big and small performance gains, bug fixes, etc.).

Both resources are worth checking out, especially if you're beginning to feel like PHP runs slowly (when in fact you haven't optimized nearly as well as you could).

 

PHP facebook

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Simulating and Troubleshooting BLOCKED Threads in Kotlin [Video]
  • How To Select Multiple Checkboxes in Selenium WebDriver Using Java
  • Strategies for Kubernetes Cluster Administrators: Understanding Pod Scheduling
  • All the Cloud’s a Stage and All the WebAssembly Modules Merely Actors

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: