What is the recommended way to deliver optimal throughput with the JavaScript SDK?

The JavaScript SDK provides the windowing feature to optimize network efficiency for performance-sensitive applications (apps that send many messages per second). The windowing feature of the JavaScript SDK automatically segments the time needed to bundle and compress messages for high throughput by specifying a long window.

As a side benefit, windowing also provides a way to guarantee that messages are delivered in the same order in which they were published.

    var pubnub = PUBNUB.init({
        windowing : 1000, // MILLISECONDS
        publish_key : 'pub-c-...',
        subscribe_key : 'sub-c-...'