Entries in performance (2)

Tuesday
Dec082009

GWT 2.0 and Speed Tracer (Campfire One)

Google Web Toolkit

via Google Web Toolkit Blog

Earlier tonight, we wrapped up a very exciting Campfire One at which we announced that GWT 2.0 is now officially available. In addition to major improvements in the GWT SDK and the Google Plugin for Eclipse, GWT 2.0 includes a brand new performance analysis tool for Chrome called Speed Tracer.

Faster development

  • Declarative UI with UIBinder
  • Google plugin for Eclipse
  • Multi-browser debugging

Faster Apps

  • Compiler optimizations
  • Code splitting
  • Speed Tracer

We hinted at it a few weeks ago, and now it’s available: Speed Tracer is a powerful new performance analysis tool for Chrome that gives you unprecedented insight into the inner workings of any web application — not just those created with GWT. Want to know why your web app feels sluggish? Speed Tracer can help you find the answer.

This video provides an overview of new features in Google Web Toolkit (GWT) 2.0, a tool which enables developers to produce highly optimized, browser-specific JavaScript for their apps. Bruce Johnson, Joel Webber, Andrew Bowers, and Adam Schuck walk you through the newest tools and features in GWT 2.0 such as uiBinder, code splitting, speed tracer, and more.

Monday
Oct052009

OMGWTFBBQ: if CONC trees replace CONS lists, then mapreduce can be parallel

Alternate title:  Mary had a little λ (kidding!)

Guy Steele: Organizing Functional Code for Parallel Execution

CONS (or “Lisp”) lists are inherently linear and sequential. One of CAR, CDR is constant-time, and the other is linear (on the length of the list). For a given list, there is only one CONS representation.

CONC primitives are null <>, singleton <42>, and “concatenation” a || b

CONC trees can represent CONS style lists, or balanced binary trees, or sparse trees, or other structures.



  • CAR CDR and CONS are compared to CONC primitives… and rather than use accessors left, right Guy prefers a SPLIT functional accessor which calls the second argument (a function) with the left and right parts as parameters.
  • Guy says this somewhere later on, and it’s easy to miss:

        “We are going to use CONC trees to optimize delay”
  • An important goal is a corollary to the equivalence 

    (cons (car xs (cdr xs)) = xs

  • It’s not this:

    (conc (left xs) (right xs)) = xs

  • but this functional gem:

    (split xs (λ (ys zs) (conc ys zs))) = xs

  • Think of the lambda λ as a continuation, and a way to keep the left and right together. In practice, split does not have to behave uniformly, but for the sake of this talk,  consider split to be purely functional with no side effects. You will notice we now have a corollary to the most low-level CONS equivalence, but one which is expressed functionally, recursively, by “binary decomposition and reassembly”

Having taken care of the basics, Guy breaks down the implementations of  MAP, REDUCE, MAPREDUCE, LENGTH, FILTER, QUICKSORT and MERGESORT for both CONS lists and the new CONC trees.

Heres the recursive mapreduce implementation with the Opportunity for Parallelism.

 

(define (mapreduce f g id xs)     ; Logarithmic in (length xs)??
  (cond ((null? xs) id)
            ((singleton? xs) (f (item xs)))
            (else (split xs (λ (ys zs)
                 (g (mapreduce f g id ys)       ; OMG Opportunity for
                     (mapreduce f g id zs))))))) ; WTF Parallelism
                                                             ; BBQ (mmmm, barbecue… <gurgle>)

 

…. Almost done! ….

 

RANT ON

If you are on Windows searching the Unicode characters looking for “LAMBDA”, you should STOP IMMEDIATELY. Search for “LAMDA” (no B). Microsoft doesn’t know how to spell “LAMBDA” much less describe its purpose in binding new variables dynamically, so the lambda (and its children) have a protected scope that hides variables in outer scopes, until the lambda completes and its scope goes away. Anyway HTML for the λ is ” &lambda; ” — that’s ampersand lambda semicolon  (no spaces)
RANT OFF