Create 156 times faster apps with P5 than with ExtJS

When it comes to Ajax, size is everything. The less bandwidth your apps consume, the more responsive they will be. In the video below, I am demonstrating in a reproducible environment, how creating a simple Ajax TreeView in ExtJS consumes 156 times the amount of bandwidth as creating the same in Phosphorus Five.

This translates into that if you’re on a really shitty internet connection, where it requires 1 second to download the P5 Ajax TreeView – It would require 2.5 minutes to download the ExtJS equivalent.

The reasons for this, is because of a concept in P5 I often refer to as “Managed Ajax”, which allows you to build almost any Ajax control you wish, and rarely if ever exceed ~5KB of JavaScript. So while you’d have to download several megabytes of JavaScript to build a simple Ajax Tree control in ExtJS, you can get away with ~5 kilobytes doing the same with P5.

If you wish to reproduce my performance test, you can find the Hyperlambda necessary to do that below the video.

Create a new “lambda” page in the System42 CMS, paste in the following code, and make sure you set its “template” settings to “empty”.

create-widget
  parent:content
  widgets
    sys42.widgets.tree
      crawl:true
      items
        root:/
      .on-get-items
        list-folders:x:/../*/_item-id?value
        for-each:x:/@list-folders/*?name
          list-folders:x:/@_dp?value
          split:x:/@_dp?value
            =:/
          add:x:/../*/return/*
            src:@"{0}:{1}"
              :x:/@split/0/-?name
              :x:/@_dp?value
          if:x:/@list-folders/*
            not
            add:x:/../*/return/*/items/0/-
              src
                class:tree-leaf
        return
          items

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s