Currently browsing category

PHP

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 …

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, …

Create PDF invoices with HTML5 and PhantomJS

Create PDF invoices with HTML5 and PhantomJS pre { background-color:#444; white-space:pre-wrap; font-size:80%; padding:0px 6px; } Creating invoices in PDF is always a bit tricky: there are many libraries to create PDF documents with PHP, but most can’t handle complex layouts and require a lot of memory and CPU time. Things …

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 …

Mass inserts updates SQLite vs MySQL update delayed inserts

Mass inserts, updates: SQLite vs MySQL (update: delayed inserts) pre { background-color:#444; white-space:pre-wrap; font-size:85%; padding:0px 6px; } Lessons learned: SQLite performs inserts 8-14 times faster then InnoDB / MyISAM SQLite performs updates 4-8 times faster then InnoDB and as fast as MyISAM SQLite performs selects 2 times faster than InnoDB …

MySQLi prepared statements

MySQLi prepared statements pre { background-color:#444; white-space:pre-wrap; font-size:85%; padding:0px 6px; } Lessons learned: Prepared statements are 13 percent faster than normal statements with escaping Prepared statements are 8 percent faster than normal statements without escaping To get improvements, you need at least 10000 inserts for 1 statement Using insert…set is …