Nooku Server loses 40% weight

40% code reduction for Nooku Server Last December we announced our plans for Nooku Server, a multi-site and multi-lingual distribution of Joomla 1.5. With the help of our community we created a diet for Nooku Server and defined a roadmap.

For the first alpha we are focusing on implementing the key ingredients of our diet. Most of the work involves removing legacy code, legacy libraries and doing clean-up. In the past weeks we have been making steady progress.

  • Core extensions: All the components, plugins and templates that didn’t made it into our list have been removed
  • XML-RPC: XML-RPC support has been removed
  • PDF: PDF support has been removed
  • Legacy: Legacy support for Joomla 1.0 and PHP4 has been removed
  • Security: All assets (css,js,images) have been moved to the media folder
  • Libraries: Legacy libraries have been removed
  • Performance: Hit support in Content and Weblinks has been removed
  • Mootools: Mootools has been upgraded to 1.2  including the compatibility layer
  • Framework: Nooku Framework has been added

With most of the refactoring completed it’s time to weigh the result. I have done a code count today to compare the code bases of Joomla 1.0, 1.5, 1.6 and Nooku Server. I used Ohcount, a little command line tool that is also used by Ohloh to do code counting.

We have made Nooku Server a whooping 40% lighter in code size. Yes, you read that right, we removed 40% code and we added a whole new framework at the same time.

Here are the detailed results:

1. Total code count

Total code count

Comparing the overall code count (php, javascript, html, css, xml) of Nooku Server with Joomla 1.5 or 1.6 we are getting a whooping +/- 45% code loss. Or almost ½ of the total code has been removed to make Nooku Server leaner and meaner.

2. Total code count – PHP

The total code comparison isn’t 100% fair as we also removed most of the frontend templates, only milkyway is still left, in Nooku Server. To be fair, let’s also compare only the PHP code. This is giving the following graph :

Total code count - PHP

Compared with 1.5: 45% less code
Compared with 1.6: 40% less code

We need to add here that Nooku Server includes Nooku Framework which has approx 10.000 lines of PHP code, if we would remove Nooku Framework  the difference would even be bigger and go over 50%.

3. Comments percentage

Another useful comparison to make is the amount of code comments. Code comments give an idea about how well the code is documented which is a measure of code quality. Again we only compare comment percentages in the PHP code.

Code comments percentage - PHP

Looking at this graph we see an slight decrease in code comments from 1.0 to 1.5, for 1.6 the amount of comments have been increased, Nooku Server is definitly in the lead.

We take alot of care in adding code comments to Nooku Framework and are constanly improving our code comments and in code documentation.

4. Total code count by type

Total code count by type

A more detailed overview of the code count per type for each of the packages. You noticed that Joomla 1.6 is roughly the same size as 1.5 even a little bigger with the added templates.

Nooku Server on the other hand is a lot leaner and meaner and is moving in the direction of the size of Joomla 1.0, while adding alot more power through the inclusion of the Nooku Framework.

So far our little diet is coming along pretty well. We will see a slight code increase again when we start adding the multi-site and multi-lingual features but we will also start refactoring components to Nooku Framework which in turn should also reduce the overall size. I will update the graphs after each alpha so you get an idea how to code size evolves over time.

Note: An interactive spreadsheet with the actual data and graphs can also be found here.

  • http://topsy.com/blog.nooku.org/2011/01/nooku-server-loses-40-weight/?utm_source=pingback&utm_campaign=L2 Tweets that mention Nooku Server loses 40% weight « Nooku Blog — Topsy.com

    [...] This post was mentioned on Twitter by Akarawuth Tamrareang, Nooku and Jeremy Wilken, Flavio Copes. Flavio Copes said: RT @nooku: Just blogged : Nooku Server loses 40% weight : http://bit.ly/eCDNre Result of our diet are in and we are getting ready for al … [...]

  • http://brian.teeman.net Brian Teeman

    I still remember the early Mambo days when the object of any “package” release was to ensure it fitted on a floppy disk

  • http://torkiljohnsen.com Torkil Johnsen

    I think the most interesting graph is the one showing changes in amount of XML. 1.6 really put on some weight!

  • http://johan.janssens.me Johan Janssens

    True, Joomla 1.6 has really added quite some xml. You could conclude based on that that 1.6 is moving more towards configuration through xml then using a 'convention over configuration' principle which we use for Nooku Framework.

  • http://johan.janssens.me Johan Janssens

    The old days, wonderful time. I'll see if I can add package sizes to the graphs in a next blog.

  • http://torkiljohnsen.com Torkil Johnsen

    What's the difference in MBs? Did it say? I couldn't find it.

  • http://johan.janssens.me Johan Janssens

    Haven't compared that. Packaging is something for beta. Will make sure to add it then.

  • http://blog.anahitapolis.com/2011/02/anahita-is-not-a-joomla-extension/ Anahita is not a Joomla extension! « Anahitapolis

    [...] the later releases we have a keen interest to use the Nooku Server as a much lighter web platform for building Anahita which could provide some really neat features [...]

  • AndrewEddie

    So are you saying Nooku server out of the box matches 1.6's complete feature set but with less code? Just want to clarify what's actually being compared here because if the feature set isn't exactly the same the comparison really looses a lot of value.

    Also, will Nooku server support 1.6 native extensions?

    Thanks in advance.

  • AndrewEddie

    Never mind, worked out the difference myself. I think you need to make a comparison by cutting out the equivalent bit from the 1.5 stack to make it apples-for-apples. Dropping the legacy layer, all but milkyway, pdf – even I can make 1.5 lighter by doing that :)

    Still, am I right in saying though that 1.5 is a watershed and you won't be supporting 1.6 and beyond?

    And in your talk you mention a lot about collaboration – are you just referring to your own Nooku based community or are you also including a future desire to do something with the core Joomla project? I could see a lot of advantages in reducing your payload even more if koowa was used to augment some of the core libraries rather than replace them, particularly when there are classes doing very similar jobs.

  • http://www.facebook.com/profile.php?id=680486992 facebook-680486992

    Hand me a knife with that FORK :)

    *Edit, btw, the FB login doesn't pull you Name from you profile.

  • AndrewEddie

    Ok, everyone knows I like a statistics challenge, so I just put a stock 1.5.22 on a brutal diet comparable to the fitness plan in Nooku server (ripped out templates, legacy layer, balanced language files, nuked PDF fonts, dropped components and modules not in Nooku Server – die com_mailto and com_wrapper, and good riddance – but leaving patTemplate in for the sake of the installation folder, and also leaving in index.html files).

    In terms of gross payload my numbers are saying Nooku Server is 7,567KB on disk, and Joomla 1.5.22 (diet) is 8,293KB on disk. That's making Nooku server a bit less than 9% lighter on that metric (I can live with that). I don't have sloccount installed to analyse the code side of things, unfortunately, but my “guess” would be the PHP would now be on par for both “diet” versions.

    For completeness, a near full 1.6 is around 12,500KB on disk (dropped excess templates and sample data images but otherwise the “full cream” version), but keep in mind 1.6 has extra components so it's not really comparing apples with apples, but there it is. Yes, 1.6 has a LOT more XML payload because of the JForm API controlling the edit screens, and there are physically more options. That's not a bad thing either way, just different.

  • http://twitter.com/stipsan Stian Didriksen

    that's to be expected since we're:
    1. Just getting started on refactoring various core components to Nooku FW, that's when you'll see the shocking results.
    2. You basically removed the same things we did, so it shouldn't be a surprise that you're left with the 9% difference, over a 40% one.

    So you removing things from the stock 1.5 core, doesn't prove anything given that we're comparing the stock distributions, not changed ones :P

  • AndrewEddie

    @Stian – not sure what happened to your comment _shrug_. The point was what you've done is akin to stripping the bark off a tree. You are still left with the the same “core log” albeit shaven, rounded and looking beautiful and fresh. I guess that's ok because your intended audience is developers acting between you and the end user. Since the core Joomla project's audience is both, making a radical strip down like that all of a sudden would have dire consequences – and hurt both our projects. One thing I'm not sure is so wise is removing API marked “deprecated” before Joomla does – I think that could have confusing consequences in the long term, but again, your audience is the bleeding edge developer to maybe you will be able to weather that.

    Awaiting answers to my other questions patiently.

  • http://k2joom.com Simon Wells

    I have the following package sizes.
    NookuServer_0.7alpha at 3,176Kb
    Joomla_1.5.22-Stable-Full_Package 6,758Kb
    Joomla_1.6.0-Stable-Full_Package 8,183Kb

    Anyone want a set of Windows 3.1 on 7 disks, hahaha

  • http://johan.janssens.me Johan Janssens

    Thanks for the package data. Looks like it's even more then 50% less when packaged.

  • http://johan.janssens.me Johan Janssens

    You want a three course meal with that ? Or just a little snack ? Seriously though for a better understanding why Nooku Server is a not a fork please see my blog post on the topic : http://johan.janssens.me/post/...

    In Nooku Server's case, we are maintaining 99% with Joomla 1.5. It's not our intend to compete with Joomla, just bundle features that are focussed on building web applications and move away from the CMS focus that Joomla has.

  • http://www.facebook.com/profile.php?id=606052250 Eric Doriean

    Not sure if its the right place for Andrew's comments or not? But would like to hear them answered. For all Joomlas faults, I like the fact that its dirty laundry is out for everybody to see. As I am looking @ Nooku server for a major project with Anahita, it would be great to hear these types of questiosn answered somewhere.

  • http://johan.janssens.me Johan Janssens

    Eric, we are gathering questions at the moment from various resources (blog, twitter, …) and will reply to those in a follow-up blog post. If you have any specific questions you would like to have answered you can post them in a reply, or you can email us : http://www.nooku.org/about/con...

  • http://twitter.com/Hackwar Hannes Papenberg

    I love this comparison. I played around with stripping down unnecessary stuff from 1.6 some time ago. I was able to (theoretically) reduce 1.6 down to about 8 MB without loosing any functionality. This meant removing the simplepie class and replacing it with a lightweight alternative, removing lots and lots and lots of duplicate code, especially in the backend components by creating some basic classes and switching tinyMCE with MooEditable. Last but not least, remove the atomic template and together with it the blueprint CSS framework and you got yourself a really small system without actually loosing any of the functionality of 1.6. Now give that shrinked version a proper scrub by removing all those unnecessary parameters and clean up further and you could get more functionality in even less code. I would bet that, with some work, you could get Joomla 1.7 down to maybe 5 MB, all the while improving the interface, making it more consistent and even adding new features like tagging, multiple categories for one item and versioning and such stuff.

    I hope that you keep on pushing and show us how great (and small) this all could be. I know that especially the people that upload their Joomla via FTP file by file will thank you big time for this. :-)

  • http://torkiljohnsen.com Torkil Johnsen

    And that's with Nooku Framework added, right?

  • http://johan.janssens.me Johan Janssens

    Yes, Nooku Server comes with the framework included. It's an extra 10k lines of PHP code.

  • http://johan.janssens.me Johan Janssens

    Thnx Hannes for the comments. We will continue to push the envelope. Work has already started to refactor components to Nooku Framework. The more code we can refactor the more code we can remove.

    By the way what class did you use to replace Simplepie ? I'm interested in looking into alternatives.

  • Andrzej Makowiecki

    Johan!
    I just spend 4 hours after midnight to write loong post in Polish Joomla! community forum about WHY Nooku Server is not fork. Why Molajo is about “ATAAW” idea. Why Nooku Server don’t try replace Joomla as Joomla do it with Mambo. Why are you so much important person in Joomla world, that have done so much for Joomla! for all this years. Why you feel you fail as a team co-founders, because of broke one of main rule – COLLABORATION:

    “If Joomla was healthy it shouldn’t take 3+ years to build a new minor version. Lot’s of competition, no collaboration #fail”

    I talk to polish community that, if all developers of Joomla have the same attitude as you represent, Joomla! for sure will be dominated whole world as a BEST CMS or whatever we call it.

    So that why I just wanted to know your answer about Andrew questions. Because for me you guys are truly Joomla! foundation as co-founders and main developers (sadly EX). So please let me know clear answer. Do Joomla core will be expanded by your contribution again? Do ever Koowa will be integrated to Joomla core? Or it will never happen?

    Sory, for that strict questions, but surely you understand my intentions. So please let us know. Regards, with all special thanks for you Johan.

  • http://www.facebook.com/profile.php?id=606052250 Eric Doriean

    Thanks Johan, I will….

  • http://twitter.com/Hackwar Hannes Papenberg

    Since we are using SimplePie for parsing feeds only, I was looking at Feedparser http://www.ajaxray.com/blog/20.../
    If you are really brave, you could also take the J1.6 JRegistry and write a JRegistryAdapter that reads (and writes) feeds to a JRegistry object. That might be even less code, but anyway, feedparser is a lot smaller than simplepie.

  • http://johan.janssens.me Johan Janssens

    Thanks Hannes, will have a look at FeedParser.

  • AmyStephen

    Andrew asked: “Still, am I right in saying though that 1.5 is a watershed and you won't be supporting 1.6 and beyond?”

    Nooku Extensions run on both 1.6 and 1.5. Nooku Server is just a distribution of 1.5. But, many are using Nooku in order to address the issue of having to have radically different versions of code for 1.5 and 1.6.

    It really helps bridge the gap.

    But, I think some of that maybe is off-topic since this is about the Server. (My apologies to Nooku.)

  • AndrewEddie

    Hi Amy. I'm well aware of the difference between a framework and a distribution and I dispute that it's logical that people would shift between Joomla distributions because they don't want to upgrade to 1.6. That doesn't make any logical sense. I'd like to see your figures that back up that statement, not to mention that it is misleading to say that “radically” different versions of code are required (but this isn't the place to discuss 1.6).

  • AmyStephen

    Meant no offense, Andrew.

  • http://blog.blueforce.ch/2011/02/nooku-server-ein-schritt-in-die-richtige-richtung/ Nooku Server – Ein Schritt in die richtige Richtung? | Rogers Blog

    [...] unbrauchbaren Sachen (wie Legacymode, Hitcounter und so Zeugs), optimiert den Quellcode, so dass er 40% schneller als eine herkömliche Joomla! 1.5 Installation wird, ergänzt zu guter letzt noch fehlende Elemente wie Multisite-Tauglichkeit und [...]

  • Jonathan

    Hope you will update Mootools 1.2 to Mootools 1.3 or higher because of the InternetExplorer9-issues.

  • AndrewEddie

    Any follow up on this? The only question I really have a burning desire to know the answer to is can we expect to see from Nooku's parent company and/or community, a statement similar to what Molajo has, that everything they do could be folded back into the core distribution where appropriate? Thanks in advance.

  • Daniel

    All the code is GPL and publicly available, so it can be added back to the J! core at any time by anyone with commit access to said core.

    Isn't that collaboration enough?

  • Daniel

    I noted this below too, so sorry for the repeats.

    Nooku FW and Nooku Server are all GPL, and publicly available for download. So the answer to your burning question is a resounding yes, any or all of it can be rolled back into the core at any time.

    Anyone could do it right now if they liked and release Joomla 1.5.24 – Nooku Edition tomorrow.

  • AndrewEddie

    Rights, that's normal GPL practice but it's also something we could say about Drupal or WordPress. What I'm hearing then is the core Joomla project can pick the eyes out of anything Nooku does, but the Nooku community doesn't really have an interest in collaborating on mutually beneficial changes in the Joomla core. That fine, but just wanted that clarification. How does then affect Nooku Server – will you do a version for each Joomla version (1.6, 1.7, 1.8) or, I've heard it said it's an alternative path for people who want to drop following the Joomla 1.6+ path?

  • Daniel

    hmm I can't reply to your post directly, so I am replying to mine Andrew.

    I am not a member of the team the build Nooku, and I am but a single member of the community. Taking what I say 'you are free to grab it at any time' and then extrapolating 'the community doesn't have an interest in…' out of it is a bit extreme.

    If you are interested in collaborating, the common practice in the Nooku community is to start a thread on the discussion group asking for collaborators or offering to collaborate.

    Given that most of still use Joomla for a lot of stuff and have a lot fo Joomla clients, I am sure a thread from someone in the PLT asking for some people to help migrate back improvements to Joomla Core would be well received. I would sign up if I knew that the work would be welcomed.

    Asking here on blog comments if there is interest from our end, without actually stating whether or not their is interest from the Joomla, then taking any reply as 'the community doesn't have an interest in…' feels like you are baiting for negative comments.

    I am sure that is not what you are doing, so if you really do want some collaboration, you should do like you advised me when I complained about 1.6 -> hop on the mailing list, say Joomla core is interested in collaborating and ask for some volunteers.

    I am sure plenty of people will put their hand up. It would benwfit us greatly to have a better Joomla core so there should be few objections.

  • AndrewEddie

    Looks like there's a reply depth limit in Discuss *sigh*.

    Re “baiting”, I repeat, I asked the question about collaboration, and confirmed Joomla's position over a year ago and Peter Russell was going to get back to me (nothing ever came of it).

    The simplest thing for me is for a Nooku dev to post on the Joomla Framework Development list with “Where do we start”, to which I'll reply “it's about time, where do you want to start”, fill out the CLA and we are off and running. If Nooku didn't base itself on Joomla, I'd certainly approach “you” on your ground (done that many times in the past for other things). However, given that Nooku is a distribution using the Joomla brand as a launchpad (and let's be honest, Nooku markets itself by putting the Joomla core down), I think the onus is on “you” (the royal you) to approach the project – that's just my opinion. Molajo seems to be able to do this even given philosophical differences so I don't see why this is so hard to do.

    At the end of the day, I don't really care – there are bits in Nooku that I would find useful but I'm just as happy to write my own alternatives in conjunction with other people who have a passion for contributing back to the Joomla core. I just want to make it clear to the rumour mill that “the project” is not an obstacle to collaboration.

  • AmyStephen

    Andrew –

    You seem to be intent on finding “real interest” in collaboration and as it turns out, so am I.

    My “Move and Copy patch” was first shared with you in December 2010. It took me about a week to write a solution that can be used by any Component in Joomla!, including Extensions. The patch implemented this feature for com_banners, com_categories, com_contact, com_content, com_menus, com_newsfeeds, and com_weblinks. It provided instructions for Community Developers to implement the feature using only a few lines of code.

    The patch was there in plenty of time to adapt to any feedback and direction but apparently my contribution was not even deserving the courtesy of a response. As a result, users do not have the feature and my time was wasted.

    I don't know what philisophical differences you think we have but maybe it boils down to very simple stuff — like what it means to treat people with respect.

    In the end, developers will contribute if there is a meritocracy in place. We are not just going to lay our babies on the porch of the Joomla! project. The onus, as it were, is on those of you with commit access to build that confidence. I challenge you to show us that you mean it when you say the Joomla! project welcomes our code submissions. What you do with your commit access will speak much more loudly than spamming someone's blog.

    I will respond to any comments, direction, critism you have to say about my patch. Let's get it in core and show through action what community collaboration looks like and why it matters.

    Respect.

    Amy

    Tracker Item (My comments at bottom): http://joomlacode.org/gf/proje...

    Initial Email I sent you in December: https://groups.google.com/d/ms...

    Johan -

    I wish I had the self respect and strength of character you have to not respond to this.

    Amy

  • http://Valanx.org David Deutsch

    I could only press the “like” button once. So let me follow up by thanking Amy for her measured, pointed and appropriate comment.

    We're all here to help and have proven that over and over again. Take it or leave it, but don't claim the opposite of what is very simple to figure out. We are a bit tired of that routine.

  • http://ninjaforge.com Daniel Chapman

    Thanks for the reply Andrew.

    I am not Peter Russell, nor am I anything more than a single, independent member of the community.

    Something you told PR a year ago has absolutely no relevance or meaning to me as I have no knowledge of it.

    All I have seen lately as the Joomla Position is that developers are lazy (Elin multiple times) volunteers are unprofessional (Ron) and those who don't like being called unprofessional are uninterested in intelligent conversation and whining. (Ron again) also that bugs won't get fixed until people get paid (Sam on the forums recently).

    Similar to Amy I too have an open ticket, and I even handed you the code in the discussion where you asked me to post on the dev forums.

    Just about everyone I speak to in the various fringe groups around Joomla has had some sort of experience that makes them feel unwelcome and unwanted when coming into the main project areas.

    Not least of all because we try to contribute and out patches and tickets languish for months with no response or feedback.

    This is the main reason why most of us have given up contributing to the core. Because we feel like no matter how hard we try to, it won't affect anything.

    So instead we choose to contribute where it is appreciated, and accepted.

    If the Joomla position is different that which is being publicly stated as above, and we are all actually welcome, then someone needs to take the barb wire fences down make the real position known and actually invite people over.

    We have all already taken the initiative and gone to the project at least once, some of us many times. But we got burnt. Now you expect us to put ourselves over the fire again with no guarantees that what we offer will be accepted or even responded to.

    I could certainly post on the dev list “where do we start?” but I already know the answer to that, because all of us have started already.

    We are all already contributing somewhere that we enjoy doing so.

    I don't enjoy visiting the Project sites much these days. Anything I say seems to end up in a fight and I get told I am one of the “usual suspects” (great PR right there) and thus should be ignored and ridiculed regardless of if my points have any merit.

    There may not be an official policy that “the project” needs to block contributions, but there is a definite perception, based usually on personal experiences that only a select few are actually valued at all in the project.

    If you want willing volunteers, then more needs to be done to break down this perception and stop people having these experiences than just commenting on a blog in a place where people actually do enjoy contributing and are actually appreciated and encouraged.

    Or in simple terms: We are having more than enough fun soccer where we are. Whenever we have tried to play soccer at your place in the past we got bullied and humiliated.

    You need to give us an invitation and a better reason than just proving (to who exactly?) that we are “passionate about contributing to Soccer” to want to give up the no-trouble, appreciated and encouraged fun we are having and risk going through all that pain and humiliation again.

    That ball is well and truly in the projects court. Don't try to make us look like the bad guys here.

  • AndrewEddie

    Amy, you are well aware of the reason I would not have received that email. Whatever the case, and not that it's any of your business, I was out of action for most of Dec '10 with vacation (in Sydney and barred from taking the laptop), the whole Christmas and New Year deal, and preparing for surgery in January (oh, and then there was all that trouble the wet stuff from the sky was causing). There are lots of things people asked me about that I didn't get to, so don't feel singled out – you were in good company.

    I can't really understand why you are so hot under that collar. I've been more than supportive of Molajo (and all the other distro's that preceded it) and respectful that you want to run things differently than the core project does (that's fine with me). I also find, from the limited media I've seen at Joomla days, that representatives also conduct themselves in a professional and respectful manner. Your comments really come from left field particularly when it's clear from issue 22590 that I could not afford to spend any more time on it (I have a business to run and a family to tend to). I contribute what I can, when I can, but if that doesn't suit your schedule, I'm afraid that is not my problem.

    Getting back on topic, I have no further questions.

  • http://blog.anahitapolis.com/2011/04/status-of-anahita-in-the-first-quarter-of-2011/ Status of Anahita in the first quarter of 2011 « Anahitapolis

    [...] are in preparation to discard Joomla! as the web platform and use the Nooku Server instead which provides a leaner and more efficient architecture suited for building next generation [...]

  • http://%/zzzqtfe31 Richelles

    Hello…

    My life,vist it http://blog.livedoor.jp/xiangcaid/archives/5760314.html ,Thanks….

  • http://blog.nooku.org/2011/10/nooku-server-on-tour/ Nooku Server on Tour « Nooku Blog

    [...] innovations have been introdcued : multi-site support, content versioning, file management, lightened Joomla core, overhauled administrator interface, mobile and dekstop support [...]

blog comments powered by Disqus