Code Monkey home page Code Monkey logo

todos-performance's Introduction

Todos Performance

This is the Meteor Todos example forked from https://github.com/meteor/todos. The application has been changed to be less performant. Run Performance.checker() in the Meteor shell to test problem solutions.

Running the app

meteor npm install
meteor

then visit localhost:3000

Be sure to wait until the fixtures have finished loading before attempting to work on each problem.

File Structure

The main files you will be working with are in /imports/api. There is a folder for each collection (todos and lists) containing Meteor methods (methods.js) and schema definitions (todos.js/lists.js). In the server folder for each collection you can find publications.js containing collection publications.

Problem 1: Todo Completion Time

Marking All Todos Complete (checkbox in the top right) is pretty slow. Use the qualialabs:profile package to take a server-side profile and determine what is causing the slowness. The profiler can be found already installed in the meteor shell at Performance.Profiler.

Problem 2: Polling Observes

The application contains a polling observe. Use the qualialabs:analyze-observes package found in the Meteor shell at Performance.Analyze to identify the polling observe and remove it.

Problem 3: Overpublishing

A large unused field is being published to the client. Use the Meteor DevTools chrome extension to identify what is being published and omit it from the list of published fields.

Problem 4: Database Indices

The application contains no indices on the Todos collection, and queries on Todos require a full collection scan. Add an index on the Todos collection to avoid paging the entire collection into memory when running queries.

Helpful Commands and Tools in the Meteor Shell

Performance.checker(): Runs a test suite for each problem.

Performance.Analyze: the qualialabs:analyze-observes package

Performance.Profiler: the qualialabs:profile package

todos-performance's People

Contributors

ericbirdsall avatar

Watchers

James Cloos avatar  avatar

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.