In our upcoming MariaDB 5.3 release Monty optimized the internal string append code for performance. I tested his patch with a plain MariaDB 5.2 vs. a patched MariaDB 5.2 with sql-bench, which showed an overall performance gain around 3%.

The details of the patch Monty describes like this

Patch to optimize string append:

While examining a trace output from a mysql-test-run case, I noticed a
lot of reallocation calls.  This was strange as MariaDB/MySQL was
designed to do so few malloc/realloc as possible.  The system uses was
to first calculate how big buffer you would need and then allocate a
buffer big enough for most usage. Then there was some safety calls to
extend the buffer if needed.

What had happened in the MySQL code over time was that new coders was
using a buffer that was not preallocated and it was filled with a lot
of append calls(), each which caused a new realloc().

I fixed a couple of the worst cases to prealloc the buffer properly,
and for the other cases I made a general fix by making the
reallocation addaptive:

The essence was to replace the realloc() call with the following function:

In MySQL 5.3, this gave a speedup for some test cases (in debug mode)
with 25 %.  For an optimized version of MySQL we got a general
performance boost of 3 %.  The difference comes from the fact that
we do a lot of extra checks for the malloc() call in a debug build and
fewer malloc() calls gives a notable speed improvement.

The full patch can be seen by doing this in the MariaDB 5.3 tree:
bzr log  -p -r monty@askmonty.org-20101108114354-jl61qx8e36gvbzm7

Here are the detailed results of the sql-bench runs. I ran sql-bench with MariaDB 5.2.2 with default settings and used MyISAM as storage engine.

Column 1 is in seconds. All other columns are presented relative
to this. 1.00 is the same, bigger numbers indicates slower.

1) MariaDB 5.2.2.
2) MariaDB 5.2.2 patched with Monty’s string append optimization.
3) MariaDB 5.2.2 patched with Monty’s string append optimization.
4) MariaDB 5.2.2 patched with Monty’s string append optimization.

The number in () after each tests shows how many SQL commands the particular
test did.  As one test may have many different parameters this gives only
a rough picture of what was done.

I ran the test on a quite fast machine and therefore you can ignore the results with run times around 0 – 3 seconds. I am adjusting the tests to run at least for 5 seconds to have more reliable results.

As machine I used our new benchmark system “pitbull”, which I also used for benchmarking the MyISAM segmented key cache performance.

I was happy to see the announcement yesterday from Tokutek regarding their addition of MariaDB to their list of supported platforms for the TokuDB storage engine.

One particular item in the press release caught my eye: “Our customers are choosing MariaDB more and more frequently for their most demanding database applications.” We’ve added many new features over the past year in our various 5.1 and 5.2 releases, but beyond the new goodies we’ve focused a lot of energy on removing bugs and improving performance. We’ve known for a while that MariaDB is the best version of MySQL out there; it’s nice that others are starting to see the same thing.

Welcome Tokutek and TokuDB to the MariaDB family!

There has been a lot happening in the MariaDB community recently, and there has been growth. Here are some of the highlights. Thank you to all our current contributors, and to others that want to contribute, shoot community[at]askmonty[dot]org an e-mail.

MariaDB 5.2.3 binaries for Solaris and Debian Sparc

Our Sparc community contributor, Mark, has continued to make popular binaries for Solaris 10 and Debian Sparc. He’s kept up to speed with MariaDB 5.2.3, so please visit him and download the binaries.

MariaDB 5.2.3 on the openSUSE Build Service

Community contributor Michal Hrušecký has packaged MariaDB for openSUSE and its available via the openSUSE build service. It is ready up to version 5.2.3, and is still in the unstable repository (it will progress further based on more testing). A benefit of the openSUSE build service is that it also churns out RPMs for CentOS, Fedora, Mandriva, Red Hat Enterprise Linux, openSUSE and SUSE Linux Enterprise.

MariaDB Virtual Machines

Again from Mark, he’s been working on creating virtual machines for people to test MariaDB with. He’s looking for feedback on which virtualization platform people are looking for VMs for. Currently there is a VM for CentOS 5.5 and Ubuntu 10.04 LTS. These are all 64-bit virtual machines. You can make use of them using VirtualBox.

Mirrors

Looking back at the releases page, we have made eleven 5.1 releases and four 5.2 releases. When we made our first 5.1 release we had one mirror (this was in April 2009). When we made our first 5.2 release, we had four mirrors (this was in April 2010). Today we are up to seven mirrors, and from recent requests I expect this to grow. If you want to mirror MariaDB, check out the Mirroring MariaDB guide on the AskMonty Knowledgebase.