Wednesday, April 16, 2008

PW Extension v0.91 is out

A new extension is now available. Here are the changes that occurred since the last update (v0.9):

- The extension can now be enabled/disabled directly from the status bar icon.

- A new popup notification appears above the status bar meter if a consistent high run time is detected.

- The extension now listens for the new "experimental-notify-plugin-call" topic name



Please note: the latest extension only works with the latest PW Core patch (v0.91).


Find the download link and installation instructions on the project wiki.

PATCH going "experimental"

There has been some discussion surrounding my patch among the more senior developers at Mozilla today and as a result I have been commissioned to change a small part of the code. The part in question is the topic with which a plugin's run time value is broadcast through the observer service.

Formerly known as 'notify-plugin-call', it is now named 'experimental-notify-plugin-call'. This change may seem small or insignificant but it actually makes a lot of sense, especially when you consider that the way the run time is currently determined and communicated is almost certain to change in future releases. This change will also mean a new version of the PW extension as it needs to be adjusted to the new topic, but the new version will also incorporate some improvements to the UI as well.

A number of people have also noted that in the performance test charts I have posted recently, the y-axis does not start at 0. Admittedly this was a bit of an oversight on my part, especially since when you do have the y-axis start at 0 my case for PW becomes much easier to make. I have therefore recreated the chart for the two tests I posted earlier - this time with the y-axis properly labeled:

Test 1



Test 2

Tuesday, April 15, 2008

What a day...

So this morning I submitted my pre-final core patch for review and got some very positive feedback. In fact it seems that as far as the core patch goes it will remain mostly the same from now until the 1.0 release. It is also ready to be checked into the tree but will most likely not make it into FF3.

In addition to releasing the latest patch, I had also created a performance test that allows a user to time how long calls made from JavaScript to an exposed Actionscript function take. The idea behind this was to run the test on a fresh build and then run this same test on a build that includes my patch. By comparing the two, it should be possible to determine what sort of overhead my code creates.

Below are the latest 2 tests that I have run:

Here is the result from test run number 1


PW ON PW OFF
Test 1 3135 3174
Test 2 3144 3156
Test 3 3139 3130
Test 4 3140 3175
Test 5 3161 3135
Test 6 3144 3153
Test 7 3156 3173
Test 8 3154 3139
Test 9 3146 3165
Test 10 3153 3154
Average 3147.2 3155.4

And some screen shots:

Test run with PW OFF:



Test run with PW ON:



Test 1 data plotted on a bar graph:



Test number one was run on minefield 3.0pre, with PW OFF running first.

And here is the result from test run number 2


PW ON PW OFF
Test 1 3176 3142
Test 2 3399 3160
Test 3 3197 3137
Test 4 3142 3159
Test 5 3155 3137
Test 6 3172 3141
Test 7 3152 3167
Test 8 3177 3148
Test 9 3166 3148
Test 10 3165 3162
Average 3190.1 3150.1

And some more screen shots:

Test run with PW OFF:



Test run with PW ON:



Test 2 data plotted on a bar graph:



Test number two was also run on minefield 3.0pre, with PW ON running first.

What these runs suggest is that the overhead that is created by my code is so minute that the difference simply "drowns" in the noise. As Chris Tyler (ctyler) put it, that places it firmly "into [the] 'who cares' territory". I tend to agree!

Tuesday, April 1, 2008

Demo 2 and PW Extension v0.9 + screenshots

So in my previous demo (demo #2) I showed Dave what was then the initial concept for the plugin activity meter. Since then I had fixed some bugs and removed a substantial amount of code.

I have decided to remove the plugin recorder feature from the extension as it would not be of much use to most end users. Instead I'm considering making the recorder into its own extension, in case anyone would find that sort of thing useful. The recorder is in fact its own class, and should be easy enough to transplant into an existing extension skeleton; for now however, there are more immediate issues I must tend to, so this will be on the back burner for now.

A lot of the missing code can also be attributed to the old method by which PW made the decision to notify the user of a high runtime. The new method is much more compact - considering it consists only of about 45 lines of code vs. the old method totaling almost 120 lines. The major difference between the two methods is in the usefulness of the information each provides. The old method sampled the runtime values over a given period of time. If a runtime of 'x' or more was reported 'y' or more number of times, the system would notify the user that the plugin might be consuming too many resources. The current method by contrast samples the runtime values within a given period of time, totaling them and then calculating this as a percentage of total time (the sampling time). The new method makes away with most all of the somewhat clunky settings in the previous extension and it also allows for a far more informative graphical representation of the load compared to that of the old method.

So now for some screen shots of the new graphical components:

First what it looks like in its inactive state.


Active, with a plugin running.



Various flash content.







Youtube video playing.



Flash video loading.



Flash based game.



Can't forget the new and compact settings dialogue.



Now that the extension is taking shape for the 1.0 release and the core patch is inching closer to the tree, I'm going to concentrate on getting the performance testing under way. In the meantime feel free to try out the extension for yourself. The details are on the project wiki page: click here.

Thursday, March 20, 2008

First demo, new Plugin Recorder features and a new core patch

First Demo:


So I had my first demo yesterday, which turned out pretty well I think. Looking back, it does feel like I have come a long way, and doing the demo helped cement that thought; which strangely motivated me to start working on some of PW's more exotic frontiers - namely lack of OSX support and the somewhat shifty Unix compatibility. To that end I started debugging late last night (or early this morning) and managed to find where all that plugin fun happens. Also I owe Mike Shaver (shaver on IRC) a big thank you for helping me make sense of that hairy code. Now I feel closer than ever to being able to implement PW on all platforms uniformly.



Plugin Recorder v0.2:


There have also been some developments in the new Plugin Recorder feature of PW - I have implemented a new option that allows the user to control how the data gets written to the file. Admittedly however, this feature would not be of great use to the large majority of people who might otherwise have interest in using PW's notifications feature. Because of this I will be shifting most of my attention to creating some type of a graphical notification feature using some sort of an existing graphical library. If you happen to know of a good one that would fit this task, don't hesitate to tell me by leaving a comment!

For those of you interested in seeing, I have created a screen capture video of a flash plugin and its run time being charted in real time using LiveGraph. I am working on compositing the two videos together and will post a link here to the uploaded video when its done.



New Core Patch:


In my second review from Robert (roc on IRC), I was instructed to switch some of my code from a MACRO into a helper function. This new PW v0.81 core patch addresses this issue by introducing a new file to the mix - dubbed nsNotifyPluginCall.cpp. This was a slightly more challenging implementation compared with the MACRO solution I came up with initially, but it was a great learning experience - teaching me how to include new files in a patch and enriching my knowledge of the build system in general. I have not yet received any feedback for this patch, but I'm fairly confident Robert would be satisfied with the changes, as they do seem to address most all of the points raised in both his reviews (Update: new review has been posted by Robert, currently working on updating my code). The only point this patch fails to address is the performance testing which still needs to get done. After talking to Dave (humph) and Chris (ctyler) I think I have a more concrete plan as to how to go about this testing. The first thing I would need is to locate (or more likely create) a page that contains a loop with JS calls into a flash object. Once I have that I would need to create a script that opens Firefox, launches the plugin page and closes the browser when the loop is done. Calling this script with the "time" command, both when PW is present and when it is not, should give me an indication if my code affects performance in any significant way.

Monday, March 17, 2008

New patch and new extension feature to assist with benchmarking

So for this 0.8 release I had done two things.

The first thing I did was some major surgery on the C++ code me and Brandon wrote at the end of last semester in OSD600. That code has not changed much since then and although these new changes are still largely cosmetic by nature, I do hope they bring me closer to the final product and ultimately to having the code integrated into FF.

The second thing I had done was add a new feature to the PW extension. This new feature allows you to record a plugin's run time to a file. If I'm correct, this should make benchmark testing of various plugins much easier. I still have to add some functionality for this feature as it is pretty basic right now but I was still able to hook it up with liveGraph (open source real time charting software) to produce a real time graphical representation of the plugin's run time. I'm planning on posting a video depicting this, as soon as I find a good screen video capture software. For now you will have to enjoy this lovely screen shot:

In case you are wondering, this depicts an interactive flash object running for approximately 8 minutes.

If you would like to try the new extension you must also use the new 0.8 patch, otherwise this will not work. You can download the necessary files and read the installation instructions on my wiki page.

As always, your feedback is appreciated, and if you have a plugin that you would like tested leave a comment with the plugin's name and a URL to a page containing it.

Tuesday, March 4, 2008

0.7 is Out

So for the 0.7 release I decided to concentrate on making the newly created extension useful and usable. I fixed some bugs and added some options to allow the user to control what should constitute a high run time they would like to be notified of. Also in the option dialogue you can now view the actual run time in real time which would be helpful to anyone installing the extension on a non debug build.

Here is a summary for all the new changes and additions:

  • Fixed notification bar bug where the user notifications would collect one on top of the other. The notification will now only appear if no other PW notifications are present.
  • Added option to turn PW on and off in the context and Tools menu.
  • Added a preference panel to the extension where a user can control various settings of PW.
    • Users may turn PW on and off.
    • Users may change the monitoring settings of PW to notify them when a certain run time has occurred, a certain number of times, within a certain period of time.
    • Users may view the current run time directly in the preference panel.
For instructions on how to install the new extension please refer to the project wiki page.