| My Tech Projects |
| Last updated: Man-O-War Cay, 13 Sep 2012 | Contact: |
| Current downloads / Notes |
|
||||
|
I'm also interested in the various ways to organize, index, and generally analyze my website (well, websites in
general). I'd like to play around with semantic web constructs. E.g. how are
my photos of fishing boats in Peru related to
photos of my dinghy and sail placement and
graphs of sailboat characteristics? I'd like to describe each
of those with semantic markup linked to (public and private) ontologies, then graphically link and navigate (pun there?) between them.
Something for the future. In the meantime, below is a HTML grapher that I found and am starting to fiddle with.
|
||||
The projects:
|
||||
- * What's needed to use the Apple Accessory Protocol? - a gem which references:
- Apple Accessory Protocol on nuxx.net Wiki
- Iphone Serial Port Tutorial
- Sparkfun's iPod connectors
- Controlling an Apple iPod with the Atmel Mega32 - a Cornell course
- Also:
- Kineteka Samsung Galaxy Tab breakout
- Apple iPod, iPhone (2g, 3g), iPad Dock connector pinout
- Apple iPod, iTouch, iPad jack pinout
- Project HiJack - simple communications with an i-device using audio (blurb)
| Hello World Remote Controller - Notes |
| Man-O-War, 25 Oct 2011 | Download |
|
||||||||
Some notes regarding the code:
References:
Installing Apache Tomcat 6 on Mac OS X (Snow) Leopard - pretty helpful
|
||||||||
| Camera Controller |
| Last updated: Melbourne, 9 Feb 2010 | Demo (you may need to use your browser's |
| zoom to fit - e.g. View > Zoom > Reset) |
| Notion: | |||||||
|
|||||||
|
Interesting problems: |
|||||||
| I think what would make this an interesting project is integrating the UI for all these functions on a snazzy device like the iPod. | |||||||
|
Here
is a mock-up of the current GUI.
Note: you might need to zoom in
or out a little in your browser for the demo pages to fit right. (e.g. "<command> +" and
"<command> -" on Firefox on a Mac, "<CTRL> +" and "<CTRL> -" on Windows, etc).
The buttons along the bottom of these mocked-up pages (as well as the "8.63 volts" drill-down button
and the "?" button) are hooked up so please try them.
The other buttons would need to invoke functions on the Arduino so they don't work here. That mock-up should look OK with any web browser, BUT if you have an iPod Touch or iPhone, to see the actual look:
|
||
|
Melbourne, 6 Mar 2010 Video of my first version: |
||
| [25 Dec 2011: I'd like to port this code to the new Arduino WiFi shield when it becomes available.] | ||
| Stereo Webcam - Notes |
| Man-O-War, 16 Dec 2010 | Download |
| Notion: | |||||||||
|
|||||||||
|
Interesting problems: |
|||||||||
|
|||||||||
|
|
|
16 Dec 2010 | |||
|
As a first pass to learn about the USB interfaces to these Logitech Orbit AF webcams and see how the stereo video is going to come out,
I wrote an Objective-C program that runs on the MacBook which controls one or two webcams. The webcam(s) are plugged directly into
the USB port(s) of the MacBook (ie. no microcontroller). If you have one or two Logitech Orbit AF webcams and OS-X (I developed it
on 10.5 and then upgraded to 10.6 when it became available so they should work), you can download my code
here. I'm still working on the demo video and some documentation. |
||||
| Everything but the kitchen sink |
|
For my boat monitoring projects this winter, I'd like to interface a bunch of sensors to my microcontrollers.
This blog entry will describe my results from interfacing them to a Raspberry Pi and/or BeagleBone -
just to shake things out and maybe try to organize a plug&play approach. I suspect the RasPi and
BeagleBone will be my preferred microcontrollers (rather than the
Arduinos that I have used in the past). The Arduinos are just too limited, IMO. For the final installation, I'd pick an |
![]() The stew as of Feb 2012 (not everything is hooked up)
Top: The GPS module (under the USB plug), the Arduino ADK
board and WiFly Shield, the 5V-3.3V level converters. Bottom: the various sensors, a Bluetooth module, and the SD card readers. |
|
|
appropriate microcontroller, PCB breadboard, container, power
supply, etc. Plus, use solder connections instead of the plug-in breadboard.
And seeing this installation art makes me want to add some kind of interactive light - maybe to the underside of the hardtop bimini. Something inspired by bioluminescent plankton that I've seen in the wake. Or a reflection like this but "reflected off" somebody in the cockpit. Hmm. |
||
| Component | Function | Where I'd like to use it |
|
Accelerometer Triple Axis Accelerometer Breakout - MMA8452Q 3-Axis Accelerometer Module |
Measure acceleration (G's) in 3 dimensions | Dinghy Black Box |
| Barometric pressure BMP085 Barometric Pressure/Temp/Altitude Sensor |
Measure barometric pressure | Weather Monitor |
| Camera Weatherproof TTL Serial JPEG Camera with NTSC Video and IR LEDs |
Takes photos and video | Boat Security Monitor |
| Compass Paralax Compass Module HMC5883L |
Measure compass heading | Dinghy Black Box |
| GPS Paralax GPS Module PMB-648 SiRF Adafruit Ultimate GPS Breakout - 66 channel w/10 Hz updates - Version 3 |
Lat/long | Dinghy Black Box |
| Gyro Paralax Gyroscope Module L3G4200D |
Measure orientation in 3 dimensions | Dinghy Black Box |
| Humidity Humidity Sensor - HIH-4030 Breakout AM2302 (wired DHT22) temp-humidity sensor |
Measure humidity | Weather Monitor |
| Logic Level Converters | Convert 5V signal to/from 3.3V | microSD, SD-MMC cards |
| Microcontrollers 1. Arduino ADK, Duemilanove, Mega, Nano USB v3 2. Raspberry Pi 3. Beagle Bone |
Microcontroller | Well, to prototype this and then the individual uses |
| Microphone Electret Microphones (4) + amp & board Breakout Board for Electret Microphone (1) |
Listen to the sound of the engine | Boat Engine Monitor |
| Motion PIR (Passive Infra-Red) Sensor |
Detects motion | Boat Security Monitor |
| Potentiometer Continuous Rotation Potentiometer |
Create a resistance depending on orientation | Dinghy Black Box - for a DIY wind direction instrument |
| Proximity Hall Effect sensors and some Magnets |
The Hall Effect sensor detects presence of the magnet |
Boat Security Monitor - for an intrusion alarm Dinghy Black Box - for a DIY anemometer Weather Monitor - for a DIY anemometer and rain gauge |
| RS232 RS232 Shifter SMD Droids SAS Serial Adapter RS232-TTL |
Interface to RS232 cable | Boat Performance Monitor and Weather Monitor - interface to the Raymarine SeaTalk multiplexor |
| SD microSD Transflash SD-MMC Card |
Read/write to SD card | Dinghy Black Box and anywhere I want to do persistent logging |
| Support 1. ChronoDot - Ultra-precise Real Time Clock - v2.1 2. Large waterproof OtterBox - 3000 3. Solar Lithium Ion/Polymer charger - v1.0, Large 6V 3.4W Solar panel - 3.4 Watt, Lithium Ion Battery Pack - 3.7V 6600mAh 4. IR sensors - TSOP38238 and Mini Remote Control |
1. RasPi doesn't include a RTC 2. They claim waterproof to 100' 3. These should all fit in (or mounted on) the Large OtterBox 4. To enable remote control (other than an iPod or Android device, which I plan to do also) |
1. Any uses that need an accurate timestamp 2. Any uses that need to be weatherproof or 3. self-powered |
| Thermometer TMP36 - Temperature Sensor One Wire Thermometer - DS18B20 |
Measure temperature | Boat Fridge Monitor and Weather Monitor |
| Wind Speed and Direction 1. My old Datamarine mast-top instrument 2. My new Raymarine mast-top instrument |
Measure wind speed and direction | 1. Dinghy Black Box 2. Boat Performance Monitor and Weather Monitor |
| Wireless 1. Asynclabs WiShield 2.0 Sparkfun WiFly Shield 2. Miniature WiFi (802.11b/g/n) Module 3. Sparkfun Bluetooth Modem - BlueSMiRF Silver |
1. WiFi for the Arduinos 2. I've ordered 3 of these - one for each of the two RasPis and one for the BeagleBone 3. I guess this could work on any of the micros | All these Boat Monitors and Dinghy Black Box |
| Dinghy Black Box |
Essentially the Boat Performance Monitor, but portable and waterproof -
that I could use on a sailing dinghy to monitor and improve my performance.
| Boat Engine Monitor |
Monitor engine RPM, temperature, oil pressure, sound, boat speed.
Plot boat speed vs. engine RPM (ideally taking into account effect of wind and waves).
| Boat Fridge Monitor |
Monitor fridge on/off cycles, power usage, fridge/cabin/seawater temperatures.
Possibly modify compressor speed to minimize power usage as described in the Frigoboat section of
this Practical Sailor article.
| Boat Performance Monitor |
| Notion: | |||||||||
|
|||||||||
|
Interesting problems: |
|||||||||
| The iPod user interface would make this snazzy, of course. But what I think would make this real interesting is keeping the history of how the boat has performed in the past on that particular point of sail. Ie. on that particular heading relative to the wind and that wind speed. Then we could use that past performance as a benchmark - can we do better? I think it would be very cool to have a public repository of performance data like this somewhere so that we could see how we compare with other boats - sort of a distributed, time-lagged sailing regatta. | |||||||||
|
| Boat Security Monitor |
| Notion: | ||
|
||
|
Interesting problems: |
||
|
This can probably be done with various off-the-shelf products. But I'm thinking I can do a better job
creating an integrated dashboard specifically for my needs. We'll see. I'd reuse parts of the Stereo Webcam and Boat Performance Monitor from above. |
||
|
| Weather Monitor |
Monitor wind speed and direction, barometric pressure, humidity, and rainfall.
Logged and plotted over time. Available via a website. Shared with
Weather Underground.
| HTML Grapher - Notes |
| Last updated: Mt. Desert Island, 3 Aug 2010 | Download the code |
I added code to allow viewing more than one page. A sample screen shot is shown below. Each connected blob represents a different page on my website (/cr34-analysis.php is yellow, /index.php is red, /sv-breakaway.php is blue, /about-me.php is green, etc). The page you're now reading, /tp.php, is purple. It looks like spindly creatures under a microscope. To me anyway. In the future, I'd like to show the links between pages and add the ability to pick which pages to show.

|
Spring Hill, 5 Feb 2012
I coded this originally to run as a Java applet (using an <applet> tag on an HTML page).
That was using Processing's ability to export a sketch as an applet in a jar file.
Even then, it worked on some versions of some browsers and not on others. I guess it was laudable
that the applet support worked as well as it did.
But, it no longer appears to be working on the current version of Firefox. Running the script under the
Processing IDE (version 1.5.1 as I write this)
is working and you can download my code from my download page). I thought about
migrating this code to use Processing.js and the <canvas> tag but it is currently dependent on a parser
in Java to parse the HTML. There is probably something available in Javascript to do this - a possible
future to-do.
In any case, I've removed the link to the applet version. The IDE version, which you can download,
is IMO still fun to play with.
|
| Monitor the battery on my Macbook |
| Man-O-War, 18 Oct 2010 | Initial (rough) pass at the server-side UI |
|
Anyway, I got to thinking that a battery cycle grapher might be interesting and could maybe help
me improve the battery life. I also saw some Apple(?) documentation suggesting that at the end
of the battery life, these power readings get erratic, so this tool may help me determine when it's
end of life is approaching (how morbid is that? :-). |
||
|
I wrote a little program that samples the same Power readings as can be viewed
in the About This Mac panel I mention above (by programatically invoking /usr/sbin/system_profiler once a minute). I currently simply write the data to a .csv file. Here is a sample of the results after formatting the .csv data a bit in Excel. |
![]() |
|
The vertical axis for the voltage (the purple line) is on the right hand side (0-14V). The plot starts (on the left) with me unplugging the charger. When it got to 5 minutes left on the battery (the bottom of the blue "V" in the graph), I plugged the charger back in. I stopped the plot when the battery indicator (on the MacBook menu bar) was showing "(Charged)". I was surfing the web and watching a DVD on the laptop while this was going on.
Man-O-War, 22 Nov 2010
| Here's the current UI. It displays the readings in realtime (albeit slowly - one sample per minute). There is also a plot of the daily min/max/ave and a plot of the battery health (current full charge capacity divided by it's capacity when it was new) and the current battery life (how long it takes to discharge from a full charge to empty). There are a couple screen samples of those plots in my Welcome page for the server side reporter. | ![]() |
|
|
I'd also like to have included the ability to overlay previous recharge cycles. But I am
stopping here. I've just recently come across a very similar
utility called MiniBatteryLogger
(although that developer's website has apparently been down for the past couple days. I am curious
to see what he was charging.. hmm.. pun there? :-). Still, I think this project was a "successful failure" in that
I learned a lot and got to try some new stuff (new for me anyway). For example, my user interface included pinch to zoom in/out
on the plots and the 2-finger gesture for scrolling the plot (that sounds a little vulgar, doesn't it?), and 3-finger swipe to
move between pages. I'll hopefully be able to resuse some of the code in future projects. And I enjoyed working on
this one. Again, the first draft of the server side of this (now defunct) app is found here. The user (running the UI, shown above, on their MacBook) would be able to post reports to the server and display them, along with others, on the Reports folder. My Aggregate Plots folder was intended to look similar to MiniBatteryLogger's Shared Data Battery Archive Page. As they say, C'est la vie. [Update: Currently, storing the sample screens from the user is not working on the server, so those parts are blacked out in the Reports folder. I need to update the version of the jdbc driver on the GoDaddy server to support writing of the images (as BLOBs) into my host database. It works on my local development server.] |
||
| Sailboat Characteristics Plotter |
| Man-O-War, 29 Nov 2010 |
The tool itself Notes |
My interactive plotter can be found here. Below is a screen sample from it, where I've selected to plot the designs for Alberg, Crealock, and Paine. You can also select from a list of builders, or from a list of all the models. The model list should be complete. The others are still under construction. Please try it out. And come back from time to time. I hope to make improvements.
|
|
2 Dec 2010 | |||
|
Here are my implementation notes. |
||||
|
|
5 Dec 2010 | |||
|
Regarding browser compatability.. I had wanted to develop this app such that the user does not require a Java plug-in
(to run an applet), as was the case for the HTML Grappher. So,
I ported the physics library to JavaScript.
The app does require HTML5 and I'm happy to say that most of the HTML5-enabled browsers appear to be playing well with the app.
Here is what I'm seeing to date: The app appears to be working well on Firefox (v 3.6.12), Opera (v 10.63), Safari (v 5.0.3), and Chrome (v 7.0.517 on Vista and 8.0.552 on Mac). It was not working well on IE8 (v 8.0.6001) - to be expected as IE8 doesn't support HTML5. On IE 9 (Beta, v 9.0.7930) the stuff does display but there are scroll bars placed around the graphical navigator. Apparently IE9 doesn't recognize the style="overflow-x: hidden; overflow-y: hidden;" that I'm using on the <frame> element for that section. I'll try to work around it (or maybe just give IE a little time to catch up). If you're on Windows, please try one of the other browsers for now. |
||||

Hmm. Regarding this project (well, all these projects), I see this as a form of self-expression. Sort of an intersection of three popular retirees' pursuits: writing, photography, and model building. I used to enjoy this sort of stuff at work.. a lot. Towards the end though, that got kind of knocked out of me. Too many co-workers asking, "Who asked you to do that/say that/think about that?". Now, I'm kind of enjoying it again. I need to say though that my manager for the last 7 or 8 years at work was very flexible and a pleasure to work for. She kept me from burning out until the very end (when she went on to a non-managerial position).
| Traer's physics library to Processing.js - Notes |
| Last updated: Man-O-War, 10 Feb 2011 | Download & samples |
| Man-O-War, 9 Dec 2010 | ||||||||||||||||||||||||||||
| Downloaded the 3.0 source code from traer.cc/mainsite/physics/ (what is now murderandcreate.com/physics). Here are
the terms from his download page:
LICENSE - Use this code for whatever you want, just send me a link jeff [at] traer.cc |
||||||||||||||||||||||||||||
| Renamed class variables so that they are not the same as accessor methods of the class. The problem is that JavaScript apparently doesn't handle the situation where there is a method called "foo()" and a variable within the class also called "foo". | ||||||||||||||||||||||||||||
| Commented out the import java.util.* in ParticleSystem and RungeKuttaIntegrator. I thought I would need to do something with ArrayList, but thankfully that appears to be supported in Processing.js so there was nothing more I needed to do there. | ||||||||||||||||||||||||||||
| To remove particles and attractions from a ParticleSystem, I tried using the existing removeParticle(Particle) and removeAttraction(Attraction) methods. They seem to work OK in the IDE, but not in the Processing.js environment. I didn't spend any time investigating. Using the removeParticle(int) and removeAttraction(int) versions seem to work OK. I added a couple methods (marked in the code with "mrn") to make using the "int" versions a little easier. | ||||||||||||||||||||||||||||
| Man-O-War, 10 Feb 2011 | ||||||||||||||||||||||||||||
| Carl Pearson made some nice
improvements to the traer3.pde
which I am reposting here as traer3a.pde. In particular, (paraphrasing him) he 1. fixed a bug in the Euler integrators where they divided by time instead of multiplying by it in the update steps, 2. eliminated the Vector3D class - converting the code to use the native PVector class, 3. did some code compaction in the RK solver, 4. added a couple nice convenience classes, UniversalAttraction and Pulse, simplifying my Pendulums sample considerably. There is a small change to the Traer library API, namely change Vector3D to PVector.
|
||||||||||||||||||||||||||||
Here is the result (download the code):
| ||||||||||||||||||||||||||||
| Here is my previous version of the library and pendulums sample code for reference. | ||||||||||||||||||||||||||||
The pendulums sample displays the frames per second (fps). Here are some results from that (original Pendulums) sample:
| Viewer | Viewer's Version OS-X / Windows | Frames per Second for pendulums sample OS-X / Windows | ||
| F.R. Undefined (default) | F.R. Limited frameRate(60) | F.R. Unlimited frameRate(9999) | ||
| Processing IDE | 1.2.1 / 1.2.1 | 60 / 60 | 60 / 60 | 460 / 433 |
| Opera | 11.00 / 11.00 | 221 / 215 | 58 / 58 | 218 / 220 |
| Chrome | 8.0.552.231 / 8.0.552.224 | 202 / 223 | 61 / 60 | 201 / 220 |
| Safari | 5.0.3 / na | 98 / na | 60 / na | 99 / na |
| IE9 Beta | na / 9.0.7930.16406 | na / 58 | na / 53 | na / 58 |
| Firefox | 3.6.13 / 3.6.13 | 47 / 36 | 47 / 35 | 47 / 36 |
|
These were all run on a 2009 13" MacBook Pro (2.53 GHz Core 2 Duo w/ 4GB RAM) OS-X: Snow Leopard v10.6.4 Windows: Vista Home Premium SP2 on Bootcamp (sorry, that's all I have) | ||||
Or graphically:

I think whether the sample can do 400 fps is a little moot - it should be limited to say, 60 fps (by making a call to frameRate(60) in setup()) to make sure it looks OK across browsers. But, the questions IMO are:
- How well does the performance scale with the complexity of sketches using this library? That is, in a larger animation (more objects, a larger canvas), does performance become unacceptible on the browsers that are marginal on this (as yet) very simple sample?
- Are there easy changes to the application or library that result in good gains? -- the low-hanging fruit.
- Why is there such a big spread between browsers? Will some browsers/platforms do better on graphics applications because they have a better graphics library implementation/hardware assist/underlying support?
- Is this wide spread seen in the JavaScript benchmarks? Can the existing benchmarks help explain it?
|
processing.org processingjs.org Jeffrey Traer's physics library Raphaël—JavaScript Library |
|
arborjs.org |
| Dromaeo Frontend |
| Man-O-War, 2 Feb 2011 | The tool (v20110112) / dromaeo.com |
- Is this wide spread seen in the JavaScript benchmarks? Can the existing benchmarks help explain it?
- Are there easy changes to the application or library that result in good gains?
-- the low-hanging fruit. - Why is there such a big spread between browsers? Will some browsers/platforms do better on graphics applications because they have a better graphics library implementation/hardware assist/underlying support?
- How well does the performance scale with the complexity of sketches using this library? That is, in a larger animation (more objects, a larger canvas), does performance become unacceptible on the browsers that are marginal on this (as yet) very simple sample?
To address that question, I added a graphics benchmark to the tool. It is based on the pendulums sample.
| Here is a screen sample of the benchmark rendering the pendulums (here, 30 balls on a 200x200 canvas): |
![]() |
And here are some results that I'm seeing on the different browsers:

Config: Chrome 8.0.552, Firefox 3.6.13, IE 9.0.7930, Opera 11.00.1156, Safari 5.0.3. IE was run on Vista SP2 on Bootcamp, the rest were on OS-X 10.6.5. All runs were on a 2009 13" MacBook Pro. Click on the image to enlarge.
Each row is a different canvas size - from 50x50 to 400x400. The columns are browsers - labeled along the top. On each graph, the y-axis is fps (ave. over a 3 sec run), the x-axis is #balls, the red line is fps without actually drawing the balls and lines, the blue line is fps drawing the graphics (using Processing.js), and the green area is the difference between them (the cost, in fps, of the circle and line drawing).
The results from Chrome are interesting - the way it appears to degrade more dramatically than the other browsers as #balls increase when the graphics are rendered. It still ends up well above the others in all cases, and still comfortably over 60 fps.
The Opera results are also interesting - that is, the degradation at 100x100/10 balls/with graphics rendered (the fork on the left of that graph). And then at
Opera makes a stronger showing than Chrome on the trivial end (small # objects/small canvas). Fixing their resource allocation problem (assuming it's not something basic that I'm not releasing in my code) will probably help in more complex animations. But, without further improvements to their code, on the more challenging end (large # objects) it will probably still be surpassed by Chrome's performance.
Man-O-War, 8 Jan 2011
I added an SVG variant to the Pendulums benchmark. Here are some results that I'm seeing:

Config: Chrome 8.0.552, Firefox 3.6.13, IE 9.0.7930, Opera 11.00.1156, Safari 5.0.3. IE was run on Vista SP2 on Bootcamp, the rest were on OS-X 10.6.5. All runs were on a 2009 13" MacBook Pro. Click on the image to enlarge.
Each row is a different canvas size - from 50x50 to 400x400. The columns are browsers - labeled along the top. On each graph, the y-axis is fps (ave. over a 10 sec run), the x-axis is #balls, the red line is fps without actually drawing the balls and lines, the green line is fps drawing the graphics using Processing.js, and the blue line is fps drawing the graphics using Raphael/SVG. The green and blue areas show the difference between not rendering and rendering using Processing.js and Raphael/SVG, respectively.
Man-O-War, 12,13 Jan 2011
I added a version of the SVG testcase that reuses the Raphael circle and line objects, rather than creating new ones for each frame. It is shown by the dashed blue line on these graphs:

Config: Chrome 8.0.552, **Firefox 3.6.13, ***Firefox 4.0b8, IE 9.0.7930, Opera 11.00.1156, Safari 5.0.3. IE was run on Vista SP2 on Bootcamp, the rest were on OS-X 10.6.5. All runs were on a 2009 13" MacBook Pro. Click on the image to enlarge.
Each row is a different canvas size - from 50x50 to 400x400. The columns are browsers - labeled along the top. On each graph, the y-axis is fps (ave. over a 10 sec run), the x-axis is #balls, the red line is fps without actually drawing the balls and lines, the green line is fps drawing the graphics using Processing.js. The solid blue line is fps drawing the graphics using Raphael/SVG creating new circle and line objects for each frame. The dashed blue line is reusing the objects from frame to frame - just changing their locations using Raphael's attr method on the objects. The green and blue areas show the difference between not rendering and rendering using Processing.js and Raphael/SVG, respectively. Please try it yourself.
The new and improved Raphael/SVG testcase (dashed blue line) generally performed better than my initial version. My initial version simply replaced the calls to Processing's ellipse() and line() with calls to Raphael's circle() and path(). The improved version allocates arrays of circle and path objects when the benchmark starts (before measuring fps starts) and then reuses them over the course of the benchmark, using Raphael's attr() method to change the locations. The odd exception is that on Safari and the 400x400 canvas on Opera, the performance got worse for the 10-ball case.
The other surprise was that with IE9 the benchmark stops during the 100x100 / 20 ball run. This occurred in the new testcase and happened on each of the 3 times I tried to run the benchmark. Ugh.
Opera showed the problem (reported above) in the first series (50x50). So it's results on the larger canvas sizes are probably degraded.
Man-O-War, 14 Jan 2011
Per a suggestion by timeu (post #11 in that thread), I ran the benchmark out to 400 balls (that's 1200 objects rendered - each pendulum is drawn as 2 circles and a line). I also changed the plots to show the Raphael/SVG testcase that reuses objects as the solid blue line (and blue area) and my original version that creates a new set of objects for each frame as the dashed blue line. Here are the current results:

Config: Chrome 8.0.552, Firefox 3.6.13, Firefox 4.0b8, Firefox 4.0b9, IE 9.0.7930, Opera 11.00.1156, Safari 5.0.3. IE was run on Vista SP2 on Bootcamp, the rest were on OS-X 10.6.5. All runs were on a 2009 13" MacBook Pro. Click on the image to enlarge.
Each row is a different canvas size - from 50x50 to 400x400. The columns are browsers - labeled along the top. On each graph, the y-axis is fps (ave. over a 10 sec run), the x-axis is #balls, the red line is fps without actually drawing the balls and lines, the green line is fps drawing the graphics using Processing.js. The dashed blue line is fps drawing the graphics using Raphael/SVG creating new circle and line objects for each frame. The solid blue line is reusing the objects from frame to frame - just changing their locations using Raphael's attr method on the objects. The green and blue areas show the difference between not rendering and rendering using Processing.js and Raphael/SVG, respectively.
On IE9, the benchmark stops during the 100x100 / 20 ball run. Opera showed the problem (reported above) in the first series (50x50). So it's results on the larger canvas sizes are probably degraded.
The benchmark is pretty simple. There are from 10 to 400 pendulums ("# balls"). Each is represented by a fixed point or particle and a free particle, as well as a spring between them. There is an attraction force (set to a negative value so they are repulsions) between all the free particles. For each frame refresh (tick of the physics system), the attraction forces are calculated between each particle and all the others. So it is an n² problem. The spring calculation and rendering are probably linear with n. So, I'd guess the complexity to be:
(n x n-1)/2 (forces) + n (springs) + n (rendering) = n²/2 - n/2 + 2n => n² + n
Man-O-War, 21 Jan 2011
|
To recap, the benchmark I used above (which was based on the pendulums sample) was dominated by
the calculations of the physics model - with a large non-linear component being figuring the attraction forces between the balls swinging
on the pendulums. To take a closer look at just the graphics performance, I made up a benchmark that just draws shapes - circles, rectangles, lines, and a short text string - in a simple loop. To the right is a screen sample. The benchmark varies from 4 to 4000 of these shapes (the datapoint of "4 shapes" renders one of each of these shapes, the datapoint for "4000 shapes" renders 1000 of each). The shapes are positioned and colored randomly from frame to frame. A table of random numbers is created at startup to avoid generating random numbers during the measurement. As before, the canvas size ranges from 50x50 to 400x400. |
![]() |
Here are the results from the different browsers:

Config: Chrome 8.0.552, Firefox 3.6.13, Firefox 4.0b9, IE 9.0.7930, Opera 11.00.1156, Safari 5.0.3. IE was run on Vista SP2 on Bootcamp, the rest were on OS-X 10.6.5. All runs were on a 2009 13" MacBook Pro. Click on the image to enlarge.
Each row is a different canvas size - from 50x50 to 400x400. The columns are browsers - labeled along the top. On each graph, the y-axis is fps (ave. over a 10 sec run), the x-axis is # shapes, the red line is fps without actually drawing the shapes, the green line is fps drawing them using Processing.js. The dashed blue line is fps drawing the graphics using Raphael/SVG creating new circle, line, rectangle and text objects for each frame. The solid blue line is reusing the objects from frame to frame - just changing their locations and color using Raphael's attr method on the objects. The green and blue areas show the difference between not rendering and rendering using Processing.js and Raphael/SVG, respectively.
Opera showed the problem (reported above) in the 500 shape testcase of the first series (50x50 canvas). So it's results on the larger canvas sizes are probably degraded. I have not included it in the plots below.
Here (v20110121) is this benchmark (called, "Just Shapes"). To run it, "Misc Graphics Tests" > "Run". There will be a log of the datapoints produced as well (in the split screen that should show up - copy & paste it into a .csv file if you want to import into a spreadsheet) The format of the data is as follows:
<m>,<n>,<# shapes>,<fps>
where <m> = canvas size; <n> = 0:wo/ rendering, 1:Processing.js, 2:Raphael/SVG V0(creates objects each frame), 3:Raphael/SVG (reuses objects)
Each datapoint is 2 seconds.
Man-O-War, 24 Jan 2011
Regarding Firefox appearing to get more efficient as #shapes increased, I wonder if they are doing some sort of clipping or z-buffer elimination of shapes that are say completely covered (and thus don't need to be rendered at all). To look at this, I made up a benchmark that draws 6x6 squares on a 400x400 canvas, with none of the squares overlapping. The result was a little disappointing because the behavior of the other browsers changed - IE9 even turned in the best SVG performance! I suspect I took too big a step away from the case I was examining - pertubating things a bit too much. Below is a screen sample from a run and the curves:
OK. I went back and made up a benchmark that is closer to the original "Just Shapes" benchmark. This time, I draw 6x6 rectangles, a 6-pixel diameter circle, an 8-pixel long diagonal line, and the letter "h" - again, none of them overlapping. The results are below. The IE9, Chrome and Safari SVG curves look very similar to the previous "Just Shapes" results of the 21st. And this time the Firefox SVG curves show modest growth as the #shapes increases. So, I suspect Firefox is doing some sort of clipping/z-buffering in it's rendering. Note that their SVG curves are again better than any of the other browsers. Kudos to their SVG rendering implementation.
Here (v20110123) is the "Tiny Squares" benchmark and here (v20110125) is the "Tiny Shapes" benchmark. To run either, "Misc Graphics Tests" > "Run". There will be a log of the datapoints produced as well (in the split screen that should show up - copy & paste it into a .csv file if you want to import into a spreadsheet) The format of the data is as follows:
<m>,<n>,<# shapes>,<fps>
where <m> = canvas size;
<n> = 0:wo/ rendering,
1:Processing.js,
2:Raphael/SVG V0(creates
3:Raphael/SVG (reuses objects)
Each datapoint is 2 seconds.
Man-O-War, 27 Jan 2011 Here (v20110126) is this benchmark (called, "Tiny Shapes 2"). To run it, "Misc Graphics Tests" > "Run". There will be a log of the datapoints produced as well (in the split screen that should show up - copy & paste it into a .csv file if you want to import into a spreadsheet) The format of the data is as follows:
<n>,<# shapes>,<fps>
where <n> = 0:wo/ rendering, 3:All, 4:Circles, 5:Lines, 6:Rectangles, 7:Text
Each datapoint is 2 seconds. There may be points where IE9 blanks out or appears to freeze, but it *should* finish - just be patient. On Safari, you may need to disable the JavaScript long-running timeout ( Develop > Disable Runaway JavaScript Timer ). I did with the more demanding version of this (10 second datapoints, up to 4000 shapes). On the other browsers, I had no problems running the benchmark.
Please send any comments to or post to this Processing.js forum entry. If you try the benchmark and see much different results - say, that IE9 performs OK on "Tiny Shapes" or that Text is not far off from Circle, Line and Rectangles in "Tiny Shapes 2", I'd like to hear about it along with something about your configuration (OS, hardware, version of IE9). All the other browsers showed slightly degraded results for Text compared with the other shapes in "Tiny Shapes 2", but nothing as dramatic as shown by IE9. Maybe it's my system.
Updates:
| 12 Jan 2011 | 1. Added a version of the SVG testcase that reuses the Raphael circle and line objects (rather than creating new ones) for each frame refresh. | ||
| 8 Jan 2011 | 1. Added an SVG testcase with comparison to rendering in Processing.js. | ||
| 3 Jan 2011 | 1. Added plots of the pendulums results. | ||
| 2 Jan 2011 |
1. Added an initial graphics benchmark - the pendulums (traer3.pde) sample. 2. Added the browser versions numbers to the output. |
||
| 26 Dec 2010 | Initial version |
Still to-do:
- Display testcase source code when user clicks on the testcase name
- Store results for a whole series using some sort of userid/password
- Look at profiling or "finger printing" a benchmark
- Look at adding hot-spot analysis
- Create a .csv format output of the results for use in a spreadsheet
|
Dromaeo wiki page (Last updated: 17 Aug 2010) Dromaeo benchmark automation script (2009) Microsoft's new IE9 triggers speed-test squabble (18 Nov 2010) Benchmark Results: JavaScript (21 Jul 2010) How Does Safari 5's JavaScript Performance Stack Up? (8 Jun 2010) |
| Man-O-War Heritage Museum Website |
| Man-O-War, 15 Mar 2011 |
| My Mac Notes |
| Saylorsburg, 12 Nov 2012 |
- Install and configure Apache, MySQL, PHP and phpMyAdmin on OSX 10.8 Mountain Lion - Very clear and concise
-- End-of-file --

































