73 votes

Is the Tildes code base really only 1.3MB?

According to the repository, “project storage” amounts to 1.3MB. I know that this doesn’t include the data/posts of course, but that still seems impossibly small: https://gitlab.com/tildes/tildes

29 comments

  1. [9]
    CosmicDefect
    Link
    Isn't it nice when a project is lightweight and not bloated? A rarity it seems in web development these days. As an aside, I don't think Tildes runs all on its lonesome. There's a stack of...

    Isn't it nice when a project is lightweight and not bloated? A rarity it seems in web development these days. As an aside, I don't think Tildes runs all on its lonesome. There's a stack of required software which makes it work which may or may not themselves have rather large and extensive codebases.

    72 votes
    1. [8]
      FarraigePlaisteach
      Link Parent
      It’s very refreshing - if that is the case! I wouldn’t count software dependencies in the project size either, unless they were patched significantly enough to be almost a different variant.

      It’s very refreshing - if that is the case! I wouldn’t count software dependencies in the project size either, unless they were patched significantly enough to be almost a different variant.

      17 votes
      1. [7]
        CosmicDefect
        Link Parent
        Here's the software stack for Tildes in case folks were curious: https://tildes.net/~comp/18bd/good_open_source_projects_to_contribute_to#comment-9nyn And here's the instructions on how to start...

        Here's the software stack for Tildes in case folks were curious: https://tildes.net/~comp/18bd/good_open_source_projects_to_contribute_to#comment-9nyn

        And here's the instructions on how to start up a dev branch of Tildes on your local machine: https://docs.tildes.net/development/initial-setup

        My heart aches that I know just enough about programing to follow the broad strokes, but not enough to actually contribute.

        47 votes
        1. [2]
          godzilla_lives
          Link Parent
          Everyone has their role to play, no matter how large or small! You're contributing just by sharing this information, and that's pretty rad.

          Everyone has their role to play, no matter how large or small! You're contributing just by sharing this information, and that's pretty rad.

          25 votes
          1. CosmicDefect
            Link Parent
            Aw, you guys (@teaearlgraycold too) are making my heart feel all warm and fuzzy. :)

            Aw, you guys (@teaearlgraycold too) are making my heart feel all warm and fuzzy. :)

            12 votes
        2. teaearlgraycold
          Link Parent
          If you have time on your hands… It’s only a matter of time before you can contribute!

          If you have time on your hands… It’s only a matter of time before you can contribute!

          9 votes
        3. Captain_Wacky
          Link Parent
          Couldn't be too terribly hard to make some custom .CSS files/values in the efforts of creating a couple themes...

          Couldn't be too terribly hard to make some custom .CSS files/values in the efforts of creating a couple themes...

          2 votes
        4. [2]
          flowerdance
          Link Parent
          I'm surprised about Postgres. I'd imagine Tildes would use NoSQL for getting information. Postgres just doesn't seem to fit the requirement of being scalable.

          I'm surprised about Postgres. I'd imagine Tildes would use NoSQL for getting information. Postgres just doesn't seem to fit the requirement of being scalable.

          1 vote
          1. [2]
            Comment deleted by author
            Link Parent
            1. CosmicDefect
              Link Parent
              There was a comment Deimos made a couple weeks ago where he said as much -- that Tildes is nowhere near overloading its server's capacity from active usage nor user volume.

              with the recent influx of reddit users, the growth rate of the database will have increased, but that doesn't mean it needs to be "webscale". the database will continue to fit in RAM for the foreseeable future. and the amount of RAM you can cram into a server is going to increase faster than Tildes' database size.

              There was a comment Deimos made a couple weeks ago where he said as much -- that Tildes is nowhere near overloading its server's capacity from active usage nor user volume.

              7 votes
  2. [11]
    Pistos
    Link
    One thousand 80-character lines is 80kb. You can do a lot with 1000 lines of code. So, relatively speaking, it (1.3 MB) actually isn't that small...

    One thousand 80-character lines is 80kb. You can do a lot with 1000 lines of code. So, relatively speaking, it (1.3 MB) actually isn't that small...

    49 votes
    1. [8]
      confusiondiffusion
      Link Parent
      My first language was assembly. I used to marvel at the size of things like printer drivers. "How is this 40MB? Is it sentient?" I couldn't imagine writing a program 1 whole megabyte in size. Then...

      My first language was assembly. I used to marvel at the size of things like printer drivers. "How is this 40MB? Is it sentient?" I couldn't imagine writing a program 1 whole megabyte in size.

      Then I learned modern programming and continue to be increasingly horrified.

      41 votes
      1. [7]
        AriMaeda
        Link Parent
        My mind's never gotten used to the bloated sizes. I did a Unity tutorial not long ago and was stunned that the output for that tutorial project—five-odd sprites and no audio/video—was just shy of...

        My mind's never gotten used to the bloated sizes. I did a Unity tutorial not long ago and was stunned that the output for that tutorial project—five-odd sprites and no audio/video—was just shy of 100MB! I had hard drives smaller than that!

        16 votes
        1. [6]
          Raistlin
          Link Parent
          What's actually happening there? Where is the increased size going to?

          What's actually happening there? Where is the increased size going to?

          5 votes
          1. [3]
            admicos
            Link Parent
            In Unity's case I imagine most of that space is going to be the engine itself, which will include everything it's capable of even if unused by the game. The real game code (before il2cpp came...

            In Unity's case I imagine most of that space is going to be the engine itself, which will include everything it's capable of even if unused by the game.

            The real game code (before il2cpp came along) should be in a file named Assembly-CSharp.dll (even outside Windows, as C# libraries share the same .dll extension as native Windows libs).

            15 votes
            1. [2]
              ComicSans72
              Link Parent
              I haven't looked at tildes but I imagine it's doing similar things. There's a server written somewhere else, and a db, and probably docker and kubernetes running somewhere if it wants to scale....

              I haven't looked at tildes but I imagine it's doing similar things. There's a server written somewhere else, and a db, and probably docker and kubernetes running somewhere if it wants to scale. The actual app is a tiny part of a big beast.

              2 votes
              1. cfabbro
                Link Parent
                https://tildes.net/~comp/18bd/good_open_source_projects_to_contribute_to#comment-9nyn

                https://tildes.net/~comp/18bd/good_open_source_projects_to_contribute_to#comment-9nyn

                Obligatory "hey Tildes is open-source". Here's the stack in case anything strikes your fancy.

                2 votes
          2. [2]
            2crzy4uall
            Link Parent
            Not an expert myself, but from what I understand it's that the higher level your coding language becomes, the larger it becomes due to needing to translate through all the levels of abstraction.

            Not an expert myself, but from what I understand it's that the higher level your coding language becomes, the larger it becomes due to needing to translate through all the levels of abstraction.

            2 votes
            1. jonah
              Link Parent
              This is partially true. It's still possible to write small applications with higher level programming. Most of the time, programs are large because of their dependencies. The other part is that we...

              This is partially true. It's still possible to write small applications with higher level programming. Most of the time, programs are large because of their dependencies. The other part is that we don't typically need our programs to be very small, so we don't usually try.

              Web applications (like Tildes) are interesting because of the unique requirement of dealing with load times over the internet, which can vary vastly from user to user. Making web apps small goes a long way for this reason. Tildes was architected to be small on purpose to solve this issue.

              10 votes
    2. tauon
      Link Parent
      That reminded me of kilo which I discovered a few years back: A pretty full-fledged editor… written in about 1000 lines of C. Without using ncurses.

      You can do a lot with 1000 lines of code.

      That reminded me of kilo which I discovered a few years back: A pretty full-fledged editor… written in about 1000 lines of C. Without using ncurses.

      3 votes
  3. [3]
    Deimos
    Link
    I think even 1.3MB would be quite a bit higher than it actually is. Since that's the amount of storage being used on GitLab, I'd assume it probably includes the size of the entire development...

    I think even 1.3MB would be quite a bit higher than it actually is. Since that's the amount of storage being used on GitLab, I'd assume it probably includes the size of the entire development history inside the git repo.

    There's also about 129kb of third-party javascript files here that the repo needs to include but aren't really "Tildes code": https://gitlab.com/tildes/tildes/-/tree/master/tildes/static/js/third_party

    About 100kb of third-party SCSS in here: https://gitlab.com/tildes/tildes/-/tree/master/tildes/scss/spectre-0.5.1

    And about 114kb of migration scripts in here that I wouldn't really consider "Tildes code" either (they're only for handling database changes between versions, not actively used at all): https://gitlab.com/tildes/tildes/-/tree/master/tildes/alembic/versions

    There's even more that I'd probably exclude if I was trying to narrow it down to only Tildes code, like some configuration files inside the Ansible directory.

    So it's hard to tell exactly, but overall I think something closer to 500kb would probably be more likely.

    48 votes
    1. FarraigePlaisteach
      Link Parent
      Wow, that’s absolutely fascinating. So not only can it fit on any old floppy disk, but it could fit on an Amiga 880k disk :)

      Wow, that’s absolutely fascinating. So not only can it fit on any old floppy disk, but it could fit on an Amiga 880k disk :)

      6 votes
    2. Wulfsta
      Link Parent
      Probably wouldn’t be hard to do a shallow git clone and figure this out for sure. I don’t have the time myself but it would certainly be an interesting figure to know.

      Probably wouldn’t be hard to do a shallow git clone and figure this out for sure. I don’t have the time myself but it would certainly be an interesting figure to know.

      4 votes
  4. devalexwhite
    Link
    That size does not include data, nor does it include Python dependencies. Each file is only a few KB (honestly the biggest file might be the license file haha).

    That size does not include data, nor does it include Python dependencies. Each file is only a few KB (honestly the biggest file might be the license file haha).

    24 votes
  5. stu2b50
    Link
    It also doesn't include any dependencies, or the python runtime. Everyone talks about "bloated electron apps", but if you were able to look at just the code in the repo, it would also be similarly...

    It also doesn't include any dependencies, or the python runtime. Everyone talks about "bloated electron apps", but if you were able to look at just the code in the repo, it would also be similarly small; the "bloat" is in the entire copy of chromium packaged with the app, and all the dependencies in node_modules. CPython is quite heavy a hefty runtime, and the virtual environment any deployment of tildes would run in would have a pretty large bin folder too.

    1.3 MB of business code is not a small number.

    17 votes
  6. [3]
    mild_takes
    Link
    Almosy all the actual content is in a database, the source code is just a way to display it. This site doesn't seem to have much complexity in the way it decides what content to display either....

    Almosy all the actual content is in a database, the source code is just a way to display it.

    This site doesn't seem to have much complexity in the way it decides what content to display either. Also lots of the code to display an actual page is going to be reused in multiple pages or many times within the same page, so its written once then referenced multiple times.

    Deimos has also said previously that a lot of the admin tasks are very manual. I take that to mean that there are no admin control panels so even less size.

    If the site scales up I'm sure there will be more code and more features to handle the problems that arise.

    Oh ya, this is also only available in English.

    I had a look at mastadon's github and their source code is 64mb and having a VERY quick glance through it to see where the size comes from... half is photos. I also found a fonts folder thats 11mb.

    8 votes
    1. FarraigePlaisteach
      Link Parent
      Great comparison with Mastodon. So it’s true; Tildes can fit on a floppy disk :)

      Great comparison with Mastodon. So it’s true; Tildes can fit on a floppy disk :)

      4 votes
    2. CosmicDefect
      Link Parent
      Yeah, Tildes just has one graphic in the logo I think which is probably just a few kB. I tried my hand at hobbyist game dev on Unity once and we spent some time discussing how to keep things...

      Yeah, Tildes just has one graphic in the logo I think which is probably just a few kB. I tried my hand at hobbyist game dev on Unity once and we spent some time discussing how to keep things lightweight. It was actually pretty fun to design good looking texture which fit our simplistic art style but barely take up any room. In modern gaming, uncompressed audio and graphics have ballooned some big name games to hundreds of GB which is crazy imo.

      4 votes
  7. Glissy
    Link
    1.3MB seems like a lot

    1.3MB seems like a lot

    1 vote