News Feed
Sections




News Archive
feed this:

Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

SitePoint PHP Blog:
PHP and Neo4j Introduction to Graph Databases
January 13, 2014 @ 12:18:52

On the SitePoint PHP blog today they've posted a new tutorial by Mehul Jain about combining PHP and Neo4J, a popular graph database tool as an alternative to the typical table-driven database structure. This is the first part of a series and only explains some of the basics behind the technology. The actual PHP implementation comes next.

For a long time, data has been typically stored in tabular form so as to increase the indexing and readability. Nowadays, the trends are changing as Graph databases are quickly gaining popularity. In fact, it would not be wrong to call them "the future of DBMS". New to the world of graphs and databases? Don't worry, by the end of this introductory article you will have sound theoretical knowledge about the topic - just enough to easily glide through the rest of the series - actual implementation.

He starts with the basics - introducing the ideas behind graph databases and some of the most basic concepts behind them. He continues, looking at common uses for them including dealing with connected data and how it lets you "move through" the data rather than jumping from record to record. He includes some real world examples if this kind of data ranging from social networks to network management.

0 comments voice your opinion now!
graph databases introduction neo4j tutorial

Link: http://www.sitepoint.com/php-neo4j-introduction-graph-databases/

Kevin Schroeder:
How much memory does Magento use?
December 10, 2013 @ 10:42:23

Kevin Schroeder was asked recently (as a part of a training class) about the amount of memory Magento actually uses during its execution. Magento is a widely-used e-commerce platform built in PHP.

Now, I know what you're supposed to set it at, but I've never measured actual usage. So I gave some bullcrap answer about how it really depends on a bunch of things and that I really shouldn't give a precise answer. But the individual persisted and I was forced to put my tail between my legs and admit that I didn't know. So I promised that I would take a look and here are my results.

He briefly mentions how he tested the memory usage of the code overall by adding an event to several spots in the application and using memory_get_usage. Using the sample Magento data he worked his way through the site and tracked the events/memory usage on the various page of the site including:

  • Main category page
  • Category page with images
  • Simple product page
  • Add to Cart

Each of these has a graph showing the memory usage at each stage. Additionally, he's graphed them all together to compare the overall memory consumption.He finishes off the post with a few summary items and conclusions from his results.

0 comments voice your opinion now!
magento memory usage consumption graph

Link: http://www.eschrade.com/page/how-much-memory-does-magento-use/

Kevin Schroeder:
More - The file system is slow
September 30, 2013 @ 10:44:29

As a follow-up to his previous article about the (minimal) overhead from logging, Kevin Schroeder has this new post focusing on the common belief that writing to the file system is the slowest method.

I had a conversation the other day by a person I respect (I respect any PHP developer who knows how to use strace) about the cost of file IO. My assertion has been, and has been for a long time, that file IO is not the boogeyman that it is claimed to be. So I decided to test a cross between those two posts.

His test was to write one million log records to two different sources - the normal physical file system, a RAM drive - one run with a file handle that's left open and the other with a new handle each time. He shows how he made the RAM drive and the PHP he used for the test (running in a VM). He graphs out the results with some interesting results...but you'll have to read the post for that.

0 comments voice your opinion now!
file system slow write log overhead benchmark ramdisk graph

Link: http://www.eschrade.com/page/more-on-the-file-system-is-slow/

PHPMaster.com:
Data Structures for PHP Devs Graphs
August 01, 2013 @ 09:52:34

PHPMaster.com has posted the fourth article in their "Data Structures for PHP Devs" series today, this time with a focus on graphs. He introduces some of the basic concepts behind them and covers two common problems that can be solved by them.

n one of my previous articles I introduced you to the tree data structure. Now I'd like to explore a related structure - the graph. Graphs have a number of real-world applications, such as network optimization, traffic routing, and social network analysis. Google's PageRank, Facebook's Graph Search, and Amazon's and NetFlix's recommendations are some examples of graph-driven applications. In this article I'll explore two common problems in which graphs are used - the Least Number of Hops and Shortest-Path problems.

He explains graphs mathematically, describing them as a set of relationships between nodes and the "lines" that connect them. There's other things involved including directions and weight, but there's not too much detail on those. Instead he gets right into the problems. First is the "Least Number of Hops" and second the "Find the Shortest Path", each with some explanation and sample code of their implementation.

0 comments voice your opinion now!
data structure graph tutorial least hops shortest path

Link: http://phpmaster.com/data-structures-4

Aleksey Korzun:
Benchmarking Memcached and Redis Clients
June 19, 2013 @ 11:06:31

Aleksey Korzun has posted some of the results from benchmarking he performed on various Memcached and Redis clients through PHP. His tests focused on multiple PHP client libraries, both user-land and extension based.

As some of you may know, I'm crazy about speed. So when I saw that people were happily using Predis as their choice of PHP client for Redis, I was a bit confused. Why use a client written in PHP for something that should be 'fast' like Redis? That kind of defeats the purpose - unless you don't really care about response times and scalability. [...] The performance difference piqued my interest. I wanted to find out just how much performance users are sacrificing by choosing one implementation over another.

He ran his tests on VirtualBox VM instances with the same specs and the same version of PHP installed. He tested various versions of the Memcached client, Redis client, Predis and the IgBinary extension. His results (Google spreadsheet) show the requests processed using each method based on this benchmarking script.You can visit the post to see the graphs of the results too.

0 comments voice your opinion now!
benchmark memcached redis client graph results

Link: http://alekseykorzun.com/post/53283070010/benchmarking-memcached-and-redis-clients

Lorna Mitchell:
PHP Version Adoption
June 04, 2013 @ 10:15:58

In this new post to her blog Lorna Mitchell takes a look at some of the current statistics around PHP version adoption - all the way from the ancient 5.0 through the shiny new (upcoming) 5.5 releases.

PHP runs over 75% of all websites whose technologies are known (source: w3techs), which makes for a really REALLY long tail of users who once installed wordpress, phpmyadmin, or some other open source project that helped their business needs at the time. What they don't do is upgrade. PHP's current usage statistics look like this (source and raw numbers are if you want them):

She points out that around half of the results show that sites are running on unsupported versions of PHP (<=5.2) but notes that it's not always their choice. There's lots of factors that play into upgrading these versions that are not always in the user's control (like the speed of distro updates). She covers some of the things that came around in the newer versions of PHP 5.2 and 5.3 including some large performance jumps, especially in 5.4.

In truth, the future is already here for those people on PHP 5.4 and beyond. Keeping PHP upgraded is just part of our regular maintenance workflow, and the language is progressing in regular and manageable steps. If you've been left behind then I strongly recommend that you start making plans for upgrading your platform, or moving to a newer one.
0 comments voice your opinion now!
version adoption php52 php53 hosting distribution graph

Link: http://www.lornajane.net/posts/2013/php-version-adoption

Symfony Blog:
The Symfony Community Survey 2012 The Results
July 27, 2012 @ 07:22:58

On the Symfony Blog there's a new post sharing the results of a recent poll they took of some of their developers covering things like job title, how long they've been working with Symfony and their work with the framework.

Before the Symfony Live Conference in Paris, we conducted the first Symfony community survey. The raffle winners will soon be contacted by Anne-Sophie. And without further ado, here are the survey results!

Results are posted both in numbers and in easy to read graphs to questions like:

  • What is your job?
  • How did you get to know symfony?
  • Do you use any other PHP framework/CMS?
  • What is the average size of projects that you/your company work on?
  • How do you get trained?

The last question is interesting - it asked the community how many would be interested in getting a Symfony certification. The results were almost broken into equal thirds of "yes", "no" and "somewhat interested. You can see the full results here.

0 comments voice your opinion now!
symfony community survey usage results graph


Sameer Borate's Blog:
Building a adjacency matrix of a graph
February 17, 2012 @ 09:19:12

Building on the graphing tutorial in his last post Sameer continues on looking at graphs in PHP with this new post showing how to create an "agency matrix" of a currently built graph.

Building a graph is not enough; we also need the ability to search through it. To make it easier to build search algorithms, it is useful if we can represent the graph and its connections in a different way; adjacency matrix being one such representation. An adjacency matrix is a means of representing which vertices (or nodes) of a graph are adjacent to which other vertices.

He includes some sample code to extract the data from a graph (built with the PEAR Structures_Graph package) and create a basic "table" of information about each nodes' connections.

0 comments voice your opinion now!
agency matrix tutorial graph structuregraph pear


Sameer Borate's Blog:
Building a Graph data structure in PHP
February 15, 2012 @ 09:35:15

In the latest post to his blog Sameer Borate takes a look at using the Structures_Graph package from PEAR to create data structures in PHP with linked nodes for directed and undirected graphs.

The Pear Structures_Graph package allows creating and manipulating graph data structures. It allows building of either directed or undirected graphs, with data and metadata stored in nodes. The library provides functions for graph traversing as well as for characteristic extraction from the graph topology.

After sharing the one-line install, he shows how to create some instances of the package's Nodes and how to connect them to a graph and link them to other nodes. He includes a few examples - a simpler one with multiple nodes joined in a directed graph, another showing how to associate data with a node and how to query the graph for node connections and testing to see if the graph is acyclic.

0 comments voice your opinion now!
graph node structure structuregraph pear package tutorial


Kurt Payne's Blog:
User register_tick_function to profile your code
February 07, 2012 @ 13:26:23

Kurt Payne has a new post to his blog showing how to use register_tick_function with a callback to help benchmark and profile your application to find its pain spots.

A profiler gives you the ability to trace the performance of your code through every function call and create an overview of your system's performance over a certain time period and helps you make intelligent decisions about where to look for problems. [...] But what if you're in an environment where you can't install [the xdebug or xhprof] extension? Luckily, php has a built-in function called register_tick_function that gives you a way to hook in to every user function that's called. With this, you can write a profiler yourself.

A bit of sample code illustrates his method - it defines a "do_profile" function and assigns it with the register_tick_function call. This function generates a debug backtrace and echos out the function path it took to get to that spot (output is included). He provides code for a bit more useful profiling and points out that it could easily be graphed to help visualize the problems. Also included are a few caveats to watch out for when using this method of profiling.

0 comments voice your opinion now!
registertickfunction profile graph performance xdebug xhprof



Community Events





Don't see your event here?
Let us know!


podcast developer laravel install interview community list wordpress unittest testing opinion threedevsandamaybe refactor code language configure release series introduction framework

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework