Is just me or Gatsby is slow?
Olimpio

Olimpio @rnrnshn

About: Front-end developer 🎨

Location:
Mozambique
Joined:
Oct 24, 2017

Is just me or Gatsby is slow?

Publish Date: Mar 31 '20
8 20

gatsby develop takes times to run than jekyll serve or I'm just tripping?🌝

Comments 20 total

  • Ben Halpern
    Ben HalpernApr 1, 2020

    I'd love to see a benchmark on the build times across static site generators. Definitely a worthy head-to-head comparison. Not a lot of other features are quite as quantifiable.

    • rhymes
      rhymesApr 1, 2020

      Just found out there are 460 static site generators so it's probably a job in itself to write a benchmark :D

      The only benchmark I'm aware of is Hugo vs Jekyll: Benchmarked:

      We ran two tests to measure build times with Hugo and Jekyll. The basic test used the default installation of Jekyll and Hugo to build sites with 10 posts,100 posts, 1,000 posts and 10,000 posts. The advanced test built those same sites but included common plugins and template code in order to create a similar set of features between the two Static Site Generators. For each build, Hugo proved to be between 23 and 63 times faster than Jekyll!

      The article also refers to Smashing Magazine having switched from Wordpress to Hugo + Netlify with build times of 13 seconds for 7500 pages.

      Hugo itself shows the following video on its homepage in which they build a 5000 pages blog in 6 seconds:

      • Olimpio
        OlimpioApr 2, 2020

        This is so amazing... Man, 5k pages in 5s💀😦😦😦...

  • Mustafa Anas
    Mustafa AnasApr 1, 2020

    It is not just you 🙂

    • Olimpio
      OlimpioApr 1, 2020

      Damn... Thought I was tripping, but how do u cope with this?

      • Mustafa Anas
        Mustafa AnasApr 1, 2020

        I don't :/
        Somethings in life you just gotta bear handling. Like my laptop being a turtle and the current quarantine lol.

        • Olimpio
          OlimpioApr 1, 2020

          LOL... Indeed... U're right

  • Pacharapol Withayasakpunt
    Pacharapol WithayasakpuntApr 1, 2020

    I would love to see if SSG support incremental builds, especially from headless CMS's and WordPress API (and dev.to API).

    This should be a solution to slow build times. Gosh, everyone knows that Android build time is much slower...

    And your clients doesn't care about your slow build times, anyway.

    • Mark Smith
      Mark SmithApr 1, 2020

      How do incremental builds work?

      If you are pulling data from APIs in building a static site are there certain types of APIs that handle incremental builds in a better way?

      • Pacharapol Withayasakpunt
        Pacharapol WithayasakpuntApr 1, 2020

        An idea is updated timestamp.

        Another idea is a SHA hash of JSON.stringify with sort keys.

        But, I know no such API.

        • Mark Smith
          Mark SmithApr 1, 2020

          Yeah I was thinking that a hash of the content would be the easiest way to identify changes quickly, but how would APIs present this data?

          Feels like a kind of complicated thing to implement, like file sync but for API data.

          • Mark Smith
            Mark SmithApr 1, 2020

            I did a bit more reading about this. I found this relevant stack overflow post.

            It seems like there are a few approaches, but generally speaking record a last-modified timestamp and send this in an API response header, so clients only download data when new stuff has been added. I guess the API could also have a feature to only send back the new stuff when a last-modified timestamp is part of the request.

            Worth considering these types of features imo when building APIs that are intended to be used in jamstack environments.

            • rhymes
              rhymesApr 1, 2020

              @patarapolw theoretically if the API supports proper HTTP caching it would work, the problem is that most generic HTTP libraries do not respect caching headers by default so it's a non starter :D

              • Mark Smith
                Mark SmithApr 1, 2020

                Not if you are building your own client :)
                There is such a massive gain in terms of optimisation that it would become worthwhile quite quickly.

  • Olimpio
    OlimpioApr 1, 2020

    Fact. I've tried 11ty too. I'll second that. I haven't tried Hugo but they say it's build time is faster than any other SSG... With Gatsby I even feel like it's slowing my computer too...

  • Brian Rinaldi
    Brian RinaldiApr 1, 2020

    Personally, yes, I agree. In fact, Jekyll used to be criticized for this but has made enormous improvements in this area. I tend to favor Hugo partly for this reason - it is blazing fast. The fact that it is written in Go, shouldn't be a concern for most folks as all you need to learn is the templating - and you can still use your frontend framework if you want.

  • Paweł Kowalski
    Paweł KowalskiApr 1, 2020

    Yeah, i guess for performance reasons Hugo is getting more popular by the day.

  • ENDEESA
    ENDEESAJan 10, 2022

    Guess I am not allowed to rant because it free....(but wow!)

Add comment