I am using VisualVM to view my processing applications. Just go to the appropriate process in VisualVM while the sketch is running. Processing is mostly Java, so most Java tools will run on your processing applications.
EDIT: Processing.js sketches can also be profiled using the Developer Tools extensions in browsers, just run the processor profile.
source share