Currently browsing category

PHP

php

Building PHP extensions with C++ the easy way

Here is an easy way to build a PHP extension with C++ and default PHP packages on a Ubuntu system. I use SWIG to wrap C++ code to the Zend API. When using loops and recursion intensively, porting a few functions to C++ can give you some extra power. First, …

Make PDFs searchable

Make PDFs searchable pre { background-color:#444; white-space:pre-wrap; font-size:80%; padding:0px 6px; } I searched for a good way to make scanned documents searchable. Most newer scanning software already has some OCR built-in, but what about all the old documents? Using pdfsandwich and Tesseract, we recover the text from each page of …

The power of column stores

The power of column stores pre { background-color:#444; white-space:pre-wrap; font-size:85%; padding:0px 6px; } using column stores instead of row based stores can reduce access logs from 10 GB to 130 MB of disk space reading compressed log files is 4 times faster than reading uncompressed files from hard disk column …

Runtime vs memory usage

Runtime vs. memory usage pre { background-color:#444; white-space:pre-wrap; font-size:80%; padding:0px 6px; } Oftentimes, better runtime can result in higher memory usage. Here is an example to create some strings to test bulk inserts on Redis: $cmd = “”;$start = microtime(true);for ($i=0; $i

Developerss time of permanency is 15 years

Developers’s time of permanency is 15 years? pre { background-color:#444; white-space:pre-wrap; font-size:90%; padding:0px 6px; } This article is not about performance of PHP, but more about performance of developers in general.A nice article from golem.de claims that the developers’s time of permanency is – exactly – 15 years. The main …

Applying Scrum to legacy code and maintenance tasks

Applying Scrum to legacy code and maintenance tasks There are some problems with Scrum that mainly occur when dealing with third party components or legacy systems: wrong estimations (time, impact, risk, complexity) bad requirements (inconsistent, incomplete, testable, conflicting, faulty) development involved in operations (bug analysis, data correction, deployment, hot-fixes) delays …

PHP Framework Comparison

PHP Framework Comparison Reading about PHP frameworks, you’ll get a lot about Symfony and Zend Framework. It is true that these frameworks have a lot of features and do great marketing. But what about performance and scalability? There are 2 kinds of frameworks: those written in C as an extension …

Members set get ArrayAccess and Iterator

Members, __set, __get, ArrayAccess and Iterator pre { background-color:#444; white-space:pre-wrap; font-size:85%; padding:0px 6px; } Lessons learned: __set() is 5 times slower than setting a member __get() + __set() is 13 times slower than incrementing a member Iterator is 4 times slower than using a member ArrayAccess is 3 times slower …

How to implement a real life benchmark with PHP

How to implement a real life benchmark with PHP pre { background-color:#444; white-space:pre-wrap; font-size:80%; padding:0px 6px; } To determine the maximum capacity of a web page, Apache ab is often used in the first step. Fetching one URL very often is optimal for caching and gives a best case. To …