{"id":3261,"date":"2013-03-14T03:10:53","date_gmt":"2013-03-13T17:10:53","guid":{"rendered":"http:\/\/www.flamingspork.com\/blog\/?p=3261"},"modified":"2013-03-07T10:53:53","modified_gmt":"2013-03-07T00:53:53","slug":"so-what-about-the-diffstat-of-mariadb-compared-to-mysql","status":"publish","type":"post","link":"https:\/\/www.flamingspork.com\/blog\/2013\/03\/14\/so-what-about-the-diffstat-of-mariadb-compared-to-mysql\/","title":{"rendered":"So what about the diffstat of MariaDB compared to MySQL?"},"content":{"rendered":"<p>So, I&#8217;ve looked at what sloccount says on the differences between Oracle MySQL over versions of itself and the various MySQL branches around. What I haven&#8217;t looked at is the diffstat. Firstly, let&#8217;s look at MariaDB.<\/p>\n<p>I&#8217;m going to look at MariaDB 5.5.29 as compared to MySQL 5.5.29, both checked out from bzr. A naive diffstat would give us:<\/p>\n<pre> 5261 files changed, 1086165 insertions(+), 122751 deletions(-)<\/pre>\n<p>And this looks like an awful lot of code that has changed: about 1,086,165 lines! This actually includes a whole other copy of InnoDB in the form of XtraDB. If we take that into account we get:<\/p>\n<pre> 5032 files changed, 864997 insertions(+), 125099 deletions(-)<\/pre>\n<p>Which is still incredibly high. Let&#8217;s look at what&#8217;s changed though. We actually see a bunch of changes in the test suite, some of which are relatively harmless, while others, like the change to rpl_tests\/rpl_innodb.test have a &#8220;&#8211;replace_result MyISAM InnoDB&#8221; line added to them, which is awfully odd (possibly legitimate, but it stuck out).<\/p>\n<p>In the end, I came up with this diff command which I think leaves us with a best diff for what is the <strong>code<\/strong> difference between MySQL 5.5 and MariaDB 5.5:<\/p>\n<pre> diff -Nru --exclude=BUILD* --exclude=.bzr* --exclude debian* \\\r\n--exclude=man* --exclude=mysql-test* --exclude=win* \\\r\n--exclude=unittest* --exclude=test* \\\r\n--exclude=support-files* --exclude=README \\\r\n--exclude=Docs --exclude=CMakeLists.txt \\\r\n--exclude=COPYING.LESSER --exclude=INSTALL* \\\r\n--exclude=KNOWN_BUGS.txt \\\r\n--exclude=cmake* mysql-5.5.29\/ mariadb-5.5.29\/<\/pre>\n<p>This is not to discount the build and test changes that MariaDB have made, but in this case I feel they distort the numbers a bit and I&#8217;ve previously just been counting C and C++ code, so it&#8217;s probably fairer this way.<\/p>\n<p>We end up with a diffstat of:<\/p>\n<pre> 1156 files changed, 326081 insertions(+), 42751 deletions(-)<\/pre>\n<p>If we then exclude the copyright notice changes and any whitespace by changing the start of the diff command to this:<\/p>\n<pre>diff -NruiEbwB --ignore-matching-lines='Copyright.*Monty' \\\r\n--ignore-matching-lines='Copyright.*Oracle'<\/pre>\n<p>We end up with a diffstat of:<\/p>\n<pre> 1129 files changed, 322821 insertions(+), 39588 deletions(-)<\/pre>\n<p>Which is a little different to what I found in my previous post (<a title=\"Permalink to MariaDB code size\" href=\"http:\/\/www.flamingspork.com\/blog\/2013\/03\/06\/mariadb-code-size\/\" rel=\"bookmark\">MariaDB code size<\/a>) that just used sloccount. There we found that MariaDB 5.5 was 187,000\u00c2\u00a0<strong>more<\/strong> lines of code than MySQL 5.5 while here we find the difference to be 283,000 lines of code. I suspect these differences to be in how diff and sloccount count things. If you do a naive count of the number of lines in source files in the sql\/ directory you get 375kLOC while sloccount says 256kLOC.<\/p>\n<p>There is still some noise in this number as there&#8217;s some Copyright notices for some of the strings code that changes, but this doesn&#8217;t seem to be too much. What about server code though? If we just diffstat the sql\/ directory (core server code), then we get:<\/p>\n<pre> 250 files changed, 83639 insertions(+), 23090 deletions(-)<\/pre>\n<p>Which is still nothing to sneeze at, sloccount tells me that MySQL 5.5.29 only has 256kLOC in the sql\/ directory to begin with and a naive wc count to be about 375kLOC.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>So, I&#8217;ve looked at what sloccount says on the differences between Oracle MySQL over versions of itself and the various MySQL branches around. What I haven&#8217;t looked at is the diffstat. Firstly, let&#8217;s look at MariaDB. I&#8217;m going to look &hellip; <a href=\"https:\/\/www.flamingspork.com\/blog\/2013\/03\/14\/so-what-about-the-diffstat-of-mariadb-compared-to-mysql\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[76,14],"tags":[506,340,628],"class_list":["post-3261","post","type-post","status-publish","format-standard","hentry","category-code","category-mysql","tag-diffstat","tag-mariadb","tag-mysql"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p5a6n8-QB","jetpack-related-posts":[{"id":3263,"url":"https:\/\/www.flamingspork.com\/blog\/2013\/03\/15\/diffstat-of-mysql-5-6-versus-5-5\/","url_meta":{"origin":3261,"position":0},"title":"diffstat of MySQL 5.6 versus 5.5","author":"Stewart Smith","date":"2013-03-15","format":false,"excerpt":"Yesterday I wrote about what the diffstat between MySQL 5.5 and MariaDB 5.5 was, and previously to that, about the MariaDB code size as reported by sloccount. Let's look at MySQL 5.6. A naive wc based \"lines of code\" for MySQL 5.6 sql\/ directory is ~490kLOC which contasts with MySQL\u2026","rel":"","context":"In &quot;code&quot;","block_context":{"text":"code","link":"https:\/\/www.flamingspork.com\/blog\/category\/code\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":4180,"url":"https:\/\/www.flamingspork.com\/blog\/2016\/09\/27\/mysql-removes-the-frm-7-years-after-drizzle-did\/","url_meta":{"origin":3261,"position":1},"title":"MySQL removes the FRM (7 years after Drizzle did)","author":"Stewart Smith","date":"2016-09-27","format":false,"excerpt":"The new MySQL 8.0.0 milestone release that was recently announced brings something that has been a looooong time coming: the removal of the FRM file. I was the one who implemented this in Drizzle way back in 2009 (July 28th 2009 according to Brian)- and I may have had a\u2026","rel":"","context":"In &quot;code&quot;","block_context":{"text":"code","link":"https:\/\/www.flamingspork.com\/blog\/category\/code\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":3238,"url":"https:\/\/www.flamingspork.com\/blog\/2013\/03\/06\/mariadb-code-size\/","url_meta":{"origin":3261,"position":2},"title":"MariaDB code size","author":"Stewart Smith","date":"2013-03-06","format":false,"excerpt":"Continuing on from my previous post,\u00c2\u00a0MySQL code size over releases. I wanted to look at the different branches\/patch sets of MySQL out there and work out how far from upstream they deviated. I'm just going to compare against whatever upstream version the most easily accessible version is based on (be\u2026","rel":"","context":"In &quot;General&quot;","block_context":{"text":"General","link":"https:\/\/www.flamingspork.com\/blog\/category\/general\/"},"img":{"alt_text":"","src":"https:\/\/docs.google.com\/spreadsheet\/oimg?key=0Ar7e3-N2Y32IdHFGRWI2ODk4ZUY4TkhrclJSVC1mb3c&oid=4&zx=imt1yst694nh","width":350,"height":200},"classes":[]},{"id":3391,"url":"https:\/\/www.flamingspork.com\/blog\/2013\/08\/09\/are-mariadb-tests-adding-anything-extra-over-oracle-mysql-tests\/","url_meta":{"origin":3261,"position":3},"title":"Are MariaDB tests adding anything extra over Oracle MySQL tests?","author":"Stewart Smith","date":"2013-08-09","format":false,"excerpt":"I grabbed all the tests introduced in MariaDB 5.5.32 (i.e. \"bzr diff -rtag:mariadb-5.5.31..mariadb-5.5.32 mysql-test\/\" and some foo) and threw them in their own test file. I only kept tests for crashing bugs and ignored those that required plugins (there were two or three, but nothing major). So now I have\u2026","rel":"","context":"In &quot;mysql&quot;","block_context":{"text":"mysql","link":"https:\/\/www.flamingspork.com\/blog\/category\/work-et-al\/mysql\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2083,"url":"https:\/\/www.flamingspork.com\/blog\/2010\/07\/22\/a-tale-of-a-bug\/","url_meta":{"origin":3261,"position":4},"title":"A tale of a bug&#8230;","author":"Stewart Smith","date":"2010-07-22","format":false,"excerpt":"So I sometimes get asked if we funnel back bug reports or patches back to MySQL from Drizzle. Also, MariaDB adds some interest here as they are a lot closer (and indeed compatible with) to MySQL. With Drizzle, we have deviated really quite heavily from the MySQL codebase. There are\u2026","rel":"","context":"In &quot;code&quot;","block_context":{"text":"code","link":"https:\/\/www.flamingspork.com\/blog\/category\/code\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":3393,"url":"https:\/\/www.flamingspork.com\/blog\/2013\/08\/09\/who-works-on-mariadb-and-mysql\/","url_meta":{"origin":3261,"position":5},"title":"Who works on MariaDB and MySQL?","author":"Stewart Smith","date":"2013-08-09","format":false,"excerpt":"Looking at the committers\/authors of patches in the bzr tree for MariaDB 5.5.31. Non Oracle Contributors: Alexander Barkov Alexey Botchkov Elena Stepanova Igor Babaev knielsen Michael Widenius sanja Sergei Golubchik Sergey Petrunya timour Vladislav Vaintroub Oracle (as they pull Oracle changes): Aditya A Akhila Maddukuri Alexander Nozdrin Anirudh Mangipudi Annamalai\u2026","rel":"","context":"In &quot;code&quot;","block_context":{"text":"code","link":"https:\/\/www.flamingspork.com\/blog\/category\/code\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/posts\/3261","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/comments?post=3261"}],"version-history":[{"count":1,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/posts\/3261\/revisions"}],"predecessor-version":[{"id":3262,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/posts\/3261\/revisions\/3262"}],"wp:attachment":[{"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/media?parent=3261"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/categories?post=3261"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/tags?post=3261"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}