Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Large Refactor: Server-side pagination and optimization #118

Merged
merged 10 commits into from Jul 13, 2015
Merged

Large Refactor: Server-side pagination and optimization #118

merged 10 commits into from Jul 13, 2015

Conversation

NickCraver
Copy link
Contributor

Many changes here that had to be wrapped together, so I'll enumerate:

  • Moves pagination server-side and eliminates the client JSON load
    delay (also fixing Google indexing)
  • Makes paging controllable via the config again
  • Normalizes config differences
  • Sets top navigation classes (and styling) on generation (eliminating
    flicker on load)
  • Eliminates the need to generate a corresponding _tag/.md entry
    for every new tag - pages are generated directly off the posts
    themselves
  • Eliminates two JavaScript file loads: hashchange and browser
  • Removes the engineering and company folders with lots of duplicate
    code (now defined in the generator and DRY coded)
  • Eliminates all global JavaScript variables (by removing most of the
    JavaScript)
  • Removes many hidden-on-load stylings since the content is
    immediately there now
  • Resolves the reverse-chronological archived comment ordering (due to
    .prepend())
  • Speeds up full rebuilds 15-25x
  • Removes paging on the author page (this is intended to be added
    back - stop-gap commit here)
  • Removes compression and the compression layout - this had very,
    very little benefit at a high cost and much more difficult dev debugging

While Jekyll is doing far more work here - it’s also doing so much faster due to optimizing how liquid is used. With a combination of removing inefficient liquid loops (especially the tag counts) and moving one-time shared generation to Ruby on the posts, builds went from 300-350 seconds on this 2013 MacBook down to 15-25 seconds.

Next steps: re-paginate authors (even the worst case, Jeff Atwood, performs fine as-is) and move archive comments to server-side generation (this needs a Python => YAML discussion Monday to be crazy efficient).

Nick Craver added 2 commits July 11, 2015 22:14
This commit does several things:
 - Moves pagination server-side and eliminates the client JSON load
delay (also fixing Google indexing)
 - Makes paging controllable via the config again
 - Normalizes config differences
 - Sets top navigation classes (and styling) on generation (eliminating
flicker on load)
 - Eliminates the need to generate a corresponding _tag/<name>.md entry
for every new tag - pages are generated directly off the posts
themselves
 - Eliminates two JavaScript file loads: hashchange and browser
 - Removes the engineering and company folders with lots of duplicate
code (now defined in the generator and DRY coded)
 - Eliminates all global JavaScript variables (by removing most of the
JavaScript)
 - Removes many hidden-on-load stylings since the content is
immediately there now
 - Resolves the reverse-chronological archived comment ordering (due to
.prepend())
 - Speeds up full rebuilds 15-25x
 - **Removes** paging on the author page (this is intended to be added
back - stop-gap commit here)
 - **Removes** compression and the compression layout - this had very,
very little benefit at a high cost and much more difficult dev debugging

While Jekyll is doing far more work here - it’s also doing so much
faster due to optimizing how liquid is used. With a combination of
removing inefficient liquid loops (especially the tag counts) and
moving one-time shared generation to Ruby on the posts, builds went
from 300-350 seconds on this 2013 MacBook down to 15-25 seconds.

Next steps: re-paginate authors and move archive comments to
server-side generation.
@NickCraver
Copy link
Contributor Author

Side note here: I don't Ruby. If someone wants to tell me everything wrong with that plugin please do. I'd actually love corrections conveyed however you like: via PR (code fixes are as good as comments to me), or here, or...whatever.

I'm sure there are missteps in there (I don't even have an IDE for Ruby installed), and I'd honestly appreciate being told what's wrong & can be better.

This also normalizes a duplicate “announcements” tag on a single post -
the rest were “announcement”
@NickCraver NickCraver mentioned this pull request Jul 12, 2015
arielitovsky and others added 7 commits July 12, 2015 15:25
This commit does several things:
 - Moves pagination server-side and eliminates the client JSON load
delay (also fixing Google indexing)
 - Makes paging controllable via the config again
 - Normalizes config differences
 - Sets top navigation classes (and styling) on generation (eliminating
flicker on load)
 - Eliminates the need to generate a corresponding _tag/<name>.md entry
for every new tag - pages are generated directly off the posts
themselves
 - Eliminates two JavaScript file loads: hashchange and browser
 - Removes the engineering and company folders with lots of duplicate
code (now defined in the generator and DRY coded)
 - Eliminates all global JavaScript variables (by removing most of the
JavaScript)
 - Removes many hidden-on-load stylings since the content is
immediately there now
 - Resolves the reverse-chronological archived comment ordering (due to
.prepend())
 - Speeds up full rebuilds 15-25x
 - **Removes** paging on the author page (this is intended to be added
back - stop-gap commit here)
 - **Removes** compression and the compression layout - this had very,
very little benefit at a high cost and much more difficult dev debugging

While Jekyll is doing far more work here - it’s also doing so much
faster due to optimizing how liquid is used. With a combination of
removing inefficient liquid loops (especially the tag counts) and
moving one-time shared generation to Ruby on the posts, builds went
from 300-350 seconds on this 2013 MacBook down to 15-25 seconds.

Next steps: re-paginate authors and move archive comments to
server-side generation.
This also normalizes a duplicate “announcements” tag on a single post -
the rest were “announcement”
@JonHMChan
Copy link
Contributor

Awesome work. Blazingly fast now.

JonHMChan added a commit that referenced this pull request Jul 13, 2015
Large Refactor: Server-side pagination and optimization
@JonHMChan JonHMChan merged commit ef9313e into StackExchange:master Jul 13, 2015
JonHMChan added a commit that referenced this pull request Jul 17, 2015
Large Refactor: Server-side pagination and optimization
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants