Code Monkey home page Code Monkey logo

gatsby-md-vs-mdx's Introduction

Markdown Benchmark Index = id

This benchmark first generates a number of randomly generated md pages (configure the number by setting NUM_PAGES=400) and then it builds.

The base for this site is gatsby-starter-blog.

This particular markdown benchmark will query pages by their id, which is (at the time of writing) faster than indexing pages by their slug.

The pre-generate script stores pages in root/markdown-pages.

Usage

yarn
yarn bench

If you want to run the same pages without regenerating them you can use yarn benchnb. It's fine to use gatsby clean regardless.

Detailed steps

Use yarn to install if you want to use gatsby-dev. Otherwise I don't think it matters between yarn or npm install.

# Requires node 8+
# nvm use 8
yarn
rm -r markdown-pages
NUM_PAGES=2000 node md.generate.js
gatsby clean
node --max_old_space_size=2000 node_modules/.bin/gatsby build

The last step could also just be gatsby build if the number of pages is small enough. The example will increase the maximum reserved "old object space" which you'll need for a larger number of pages.

gatsby-md-vs-mdx

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.