Performance Characteristics of Modern JavaScript Systems

Performance Characteristics of Modern JavaScript Systems

Consider a modern system based on React, Redux, Meteor and MongoDB. Such a system conforms to an architectural ideal that I call Absolute MVC, in which the user interface is updated exclusively in response to state changes (i.e., UI actions or back-end changes). Meteor Live Query is state-of-the-art with respect to detecting back-end changes and pushing them to the UI via Websockets, particularly when MongoDB oplog tailing is enabled. This allows the UI to be 100% event-driven.

In my own experience, modern system performance isn’t usually constrained by the server; in fact, this is one of the advantages of a JavaScript-based SaaS application: a remarkable amount of processing can be offloaded to the client. Consider that with a traditional web application based on LAMP, all HTML rendering is done on the server and that HTML result is sent to the client on a silver platter. Moving those rendering functions to the client dramatically reduces the load on the server, and that can consequently reduce hosting costs.

What are the performance considerations of a modern JavaScript system? It all boils down to one word: rendering. State changes trigger event listeners that must judiciously re-render parts of the UI.

In React/Redux/Meteor, a recurring concern is whether a given component should be sensitive or insensitive to state changes. By default, React components will re-render unconditionally in response to state changes, so one of the low-hanging optimizations is to hand-craft rules that can analyze state changes and prevent re-rendering unless absolutely necessary. These rules are expressed in React lifecycle method shouldComponentUpdate.

In short, performance optimization of modern JavaScript system is largely a matter of minimizing rendering and re-rendering.

要查看或添加评论,请登录

David Lynch的更多文章

  • The Secret to Successful Projects

    The Secret to Successful Projects

    Since you are reading this, you may be hoping for a list of policies and procedures to make your projects run more…

  • The Awesome Power of MVC Web Applications

    The Awesome Power of MVC Web Applications

    In the mid-1990s, I became obsessed with the Observer pattern. Geeks familiar with book Design Patterns will…

  • Cost Advantages of React Framework-Driven Development

    Cost Advantages of React Framework-Driven Development

    Developing an enterprise-class SaaS application from scratch is a big undertaking with many separate aspects. When…

  • Reign of the Front End

    Reign of the Front End

    For the past five years, I have thrown myself head-first into the world of JavaScript, React, Meteor, Node.js and…

    1 条评论
  • Reconciling React and CSS

    Reconciling React and CSS

    A key benefit of React is the potential of reduced cost through component-based development. Intuitively, the idea of…

  • The Iceberg

    The Iceberg

    Beneath any modern software project lies a vast, invisible effort. The typical user sees only the the tip of an…

  • React/Meteor/Node.js Development on Windows

    React/Meteor/Node.js Development on Windows

    For the first two years of my tenure with React, Node.js, Meteor and MongoDB, I worked exclusively within Ubuntu VMWare…

  • JavaScript Functions That Run Beautifully on Client and Server

    JavaScript Functions That Run Beautifully on Client and Server

    One of the compelling benefits of Node.js is that a single language, JavaScript, can be used on client and server.

  • VXFrame: A React/Meteor Multitenant SaaS Framework (Part 6 of 6)

    VXFrame: A React/Meteor Multitenant SaaS Framework (Part 6 of 6)

    Core Subsystems VXFrame comes with core subsystems that are essential for most multi-tenant SaaS applications…

  • VXFrame: A React/Meteor Multitenant SaaS Framework (Part 5 of Many)

    VXFrame: A React/Meteor Multitenant SaaS Framework (Part 5 of Many)

    Modals VXModal components are wrappers for Bootstrap modals. Traditionally, Bootstrap modals have been pre-rendered…

社区洞察

其他会员也浏览了