{"id":3254,"date":"2013-03-12T05:07:07","date_gmt":"2013-03-11T19:07:07","guid":{"rendered":"http:\/\/www.flamingspork.com\/blog\/?p=3254"},"modified":"2013-03-06T14:36:55","modified_gmt":"2013-03-06T04:36:55","slug":"is-mysql-bigger-than-linux","status":"publish","type":"post","link":"https:\/\/www.flamingspork.com\/blog\/2013\/03\/12\/is-mysql-bigger-than-linux\/","title":{"rendered":"Is MySQL bigger than Linux?"},"content":{"rendered":"<p>I&#8217;m going to take the numbers from my previous post, <a href=\"http:\/\/www.flamingspork.com\/blog\/2013\/03\/08\/mysql-modularity-are-we-there-yet\/\">MySQL Modularity, Are We There Yet?<\/a> for the &#8220;kernel&#8221; size of MySQL &#8211; that is, everything that isn&#8217;t a plugin or storage engine.<\/p>\n<p>For Linux kernel, I&#8217;m just going to use the a-bit-old git tree I have on my laptop. I&#8217;ve decided that the following directories are for &#8220;plugins&#8221;\u00c2\u00a0drivers\/ arch\/ sound\/ firmware\/ crypto\/ usr\/ virt\/ tools\/ scripts\/ fs\/*\/* and everything else is core kernel code.<\/p>\n<table>\n<thead>\n<tr>\n<td><strong>Version<\/strong><\/td>\n<td><strong>Total LoC<\/strong><\/td>\n<td><strong>Total Plugin LoC<\/strong><\/td>\n<td><strong>Remaining (kernel)<\/strong><\/td>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>MySQL 5.6.10<\/td>\n<td>1,049,344<\/td>\n<td>265,189<\/td>\n<td>784,155 (74% kernel)<\/td>\n<\/tr>\n<tr>\n<td>MariaDB 5.5<\/td>\n<td>1,142,118<\/td>\n<td>315,796<\/td>\n<td>826,322 (72% kernel)<\/td>\n<\/tr>\n<tr>\n<td>Linux<\/td>\n<td>9,983,269<\/td>\n<td>8,824,121<\/td>\n<td>1,159,148 (11% kernel)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>The scary thing is that it&#8217;s surprisingly close, MySQL\/MariaDB core is roughly 68-71% the \u00c2\u00a0size of the Linux kernel. This is probably an unfairly large number for Linux too as there&#8217;s much more of Linux that is pluggable and modular&#8230; so I actually suspect they&#8217;re closer to exactly the same size.<\/p>\n<p>If we look at the net\/ directory in linux, it&#8217;s a grand total of 493,000 lines of code, all of which is fairly modular and independent. <strong>You could, quite reasonably, claim that the core of Linux is in fact closer to half a million lines of code than a million, making MySQL significantly larger.<\/strong><\/p>\n<p>So how many engineers are looking after each code base? We know there are over a thousand Linux kernel developers contributing to each release (e.g.\u00c2\u00a0<a href=\"https:\/\/lwn.net\/Articles\/395961\/\">https:\/\/lwn.net\/Articles\/395961\/<\/a>\u00c2\u00a0for data back in 2010, and <a href=\"https:\/\/lwn.net\/Articles\/537110\/\">https:\/\/lwn.net\/Articles\/537110\/<\/a>\u00c2\u00a0for Feb 2013).<\/p>\n<p>I&#8217;m now going to fudge some things to attempt to work out how many &#8220;developers&#8221; are working on linux core code rather than drivers and arch specific things. I work out there&#8217;s probably about 20-25% of linux developers who work on things that are not drivers, filesystems or arch code. This is around 250-300 developers for each kernel release.<\/p>\n<p>So&#8230; how many people have <strong>ever<\/strong> committed code to MySQL? This is fairly easy to find out: I simply looked at the entire bzr history, grepped out every committer and then uniqued the list (this required more than just sort -u as people used different email addresses and names). <strong>How many people have ever committed code to MySQL (i.e. their code can be found in the MySQL 5.6 bzr tree)? <\/strong>312.<\/p>\n<p><strong>How many committers to MySQL 5.6 are there? 161.\u00c2\u00a0<\/strong>This is pretty amazing, that&#8217;s about <strong>half<\/strong> of what the total is. However, <strong>this number is misleading<\/strong>. For example, my name is there and the last commit to the MySQL tree from me was in 2008. You also see names such as Monty Taylor and Kristian Nielsen &#8211; all three of us not having worked for MySQL\/Sun\/Oracle for a great number of years. At the very least,<strong> there&#8217;s been a lot of code integration into MySQL 5.6 from many existing sources<\/strong> that were not previously in MySQL trunk.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;m going to take the numbers from my previous post, MySQL Modularity, Are We There Yet? for the &#8220;kernel&#8221; size of MySQL &#8211; that is, everything that isn&#8217;t a plugin or storage engine. For Linux kernel, I&#8217;m just going to &hellip; <a href=\"https:\/\/www.flamingspork.com\/blog\/2013\/03\/12\/is-mysql-bigger-than-linux\/\">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":[141,340,628],"class_list":["post-3254","post","type-post","status-publish","format-standard","hentry","category-code","category-mysql","tag-linux","tag-mariadb","tag-mysql"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p5a6n8-Qu","jetpack-related-posts":[{"id":3237,"url":"https:\/\/www.flamingspork.com\/blog\/2013\/03\/08\/mysql-modularity-are-we-there-yet\/","url_meta":{"origin":3254,"position":0},"title":"MySQL modularity, are we there yet?","author":"Stewart Smith","date":"2013-03-08","format":false,"excerpt":"MySQL is now over four times the size than it was with MySQL 3.23. This has not come in the shape of plugins. Have we improved modularity over time? I decided to take LoC count for plugins and storage engines (in the case of Drizzle, memory, myisam and innobase 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":3257,"url":"https:\/\/www.flamingspork.com\/blog\/2013\/03\/13\/which-is-bigger-mysql-or-postgresql\/","url_meta":{"origin":3254,"position":1},"title":"Which is bigger: MySQL or PostgreSQL?","author":"Stewart Smith","date":"2013-03-13","format":false,"excerpt":"From my previous posts, we have some numbers (excluding NDB) for the size of MySQL, so what about PostgreSQL? Here, I used PostgreSQL git trunk and classing things in the contrib\/ directory as plugins. I put the number of lines of code in the src\/backend\/storage directory down as storage engines\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":3959,"url":"https:\/\/www.flamingspork.com\/blog\/2015\/04\/28\/going-beyond-1-3-million-sql-queriessecond\/","url_meta":{"origin":3254,"position":2},"title":"Going beyond 1.3 MILLION SQL Queries\/second","author":"Stewart Smith","date":"2015-04-28","format":false,"excerpt":"So, on a large IBM POWER8 system I was recently running the newly coined \"yesmark\" benchmark, which is best translated as this: Benchmark (N for concurrency): for i in {1..N}; do yes \"DO 0;\" | mysql > \/dev\/null & done Live results: mysqladmin -ri 1 extended-status | grep Questions Which\u2026","rel":"","context":"In &quot;IBM&quot;","block_context":{"text":"IBM","link":"https:\/\/www.flamingspork.com\/blog\/category\/work-et-al\/ibm-work-et-al\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":715,"url":"https:\/\/www.flamingspork.com\/blog\/2006\/06\/14\/arjens-mysql-community-journal-hyperthreading-not-on-a-mysql-server\/","url_meta":{"origin":3254,"position":3},"title":"Arjen&#8217;s MySQL Community Journal &#8211; HyperThreading? Not on a MySQL server&#8230;","author":"Stewart Smith","date":"2006-06-14","format":false,"excerpt":"Arjen's MySQL Community Journal - HyperThreading? Not on a MySQL server... I blame the Linux Process Scheduler. At least it's better than the earlier 2.6 days where things would get shunted a lot from one \"cpu\" to the other \"cpu\" for no real reason. Newer kernel verisons are probably better...\u2026","rel":"","context":"In &quot;linux-kernel&quot;","block_context":{"text":"linux-kernel","link":"https:\/\/www.flamingspork.com\/blog\/category\/linux-kernel\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":3884,"url":"https:\/\/www.flamingspork.com\/blog\/2014\/10\/14\/mysql-5-7-5-on-power-thread-priority\/","url_meta":{"origin":3254,"position":4},"title":"MySQL 5.7.5 on POWER &#8211; thread priority","author":"Stewart Smith","date":"2014-10-14","format":false,"excerpt":"Good news everyone! MySQL 5.7.5 is out with a bunch more patches for running well on POWER in the tree. I haven't yet gone and tried it all out, but since I'm me, I look at bugs database and git\/bzr history first. On Intel CPUs, when you're spinning on a\u2026","rel":"","context":"In &quot;IBM&quot;","block_context":{"text":"IBM","link":"https:\/\/www.flamingspork.com\/blog\/category\/work-et-al\/ibm-work-et-al\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":706,"url":"https:\/\/www.flamingspork.com\/blog\/2006\/05\/31\/davem-on-ingos-smp-lock-validator\/","url_meta":{"origin":3254,"position":5},"title":"DaveM on Ingo&#8217;s SMP lock validator","author":"Stewart Smith","date":"2006-05-31","format":false,"excerpt":"DaveM talks about Ingo's new SMP lock validator for linux kernel A note reminding me to go take a look and see what can be ripped out and placed into various bits of MySQL and NDB. Ideally, of course, it could be turned into a LD_PRELOAD for pthread mutexes. Anybody\u2026","rel":"","context":"In &quot;General&quot;","block_context":{"text":"General","link":"https:\/\/www.flamingspork.com\/blog\/category\/general\/"},"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\/3254","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=3254"}],"version-history":[{"count":2,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/posts\/3254\/revisions"}],"predecessor-version":[{"id":3256,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/posts\/3254\/revisions\/3256"}],"wp:attachment":[{"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/media?parent=3254"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/categories?post=3254"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/tags?post=3254"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}