Tuesday, December 9, 2008

0.3 Release

So this is my last contribution to the OSD 600 Course but not my last contribution to my project. With this release I will be slowing down my activity but I hope I find the time to finish what I have started.

0.3 Release Details
My 0.3 Release project release can be found here.

The summary is I have landed a patch that keeps PGO for Thunderbird breaking on Windows. A module in the mozilla-core called lcms breaks when it is not linked into the xul library. The patch basically disables pgo for that module if it is not being linked into the library otherwise pgo is enabled for it.

As I was trying to enable pgo for Thunderbird related modules I discovered that PGO gets enabled for all modules. This was good news until I noticed that only 5 modules were getting optimized out of 74.

As I looked into this it turned out that the folder that most of the profile data was in was being deleted before used to optimize the modules. I created a new bug for this problem.

I have added my proposed patch and using that patch and doing some simple profiling 69 of 74 modules were optimized.

And that is my 0.3 Release.

I have learned about using Make and Python and compiler options for PGO. I still don't understand PGO entirely and don't understand why it does what it does. Example would be when using the option to optimize for size the compile spits out that the module was optimized for speed. I guess at some point I should make an inquiry on the Microsoft forums.

I plan on taking the OSD700 class but am looking at working with Eclipse.

Monday, December 8, 2008

Thunderbird components getting Optimized

So the problem I ran into with optimizing Thunderbird was all the profile data was getting deleted before it was used. I opened a new bug for this.

The other part of the problem was the python script, pgomerge.py, was not looking in the objdir/dist/bin/components for the profile data. So I have edited the pgomerge.py file and it does find and merge in all the profile data.

AWESOME!!!

New problem...the profile data in the dist/bin is not getting touched. I pretty sure my script is broken.

Time to look into this python stuff some more.

Saturday, December 6, 2008

New Bug for PGO

I've been trying to enable pgo on different Thunderbird components but I've been having problems.

Problem
The build output says these files are compiled with optimization flags but no optimization data is being collected.

It turns out the data is being collected and placed in the objdir/dist/bin/components directory. BUT!!!! This folder gets deleted.

I told ted about this. Here is a paraphrase of our conversation.

Basically, i need a flag to tell the make not to delete the folder when second profile build is being done and to look in the right directory for the optimization files.

I have posted a bug about this. This will be interesting to see how many components will get optimized without breaking.

Patch Landed!

My Patch has made it into mozilla-central.
Here is the patch.
Here is the bug.
Here is my happy dance.

Friday, December 5, 2008

Patch Reviewed!

Sweet! My patch was reviewed.

I just have to fix the comments in the patch and it is good to go.

I'm not sure what to do after I attach the updated patch.
This is the bug.

Optimizing the Thunderbird Address Book - cont'd.

I am still attempting to generate some optimization data for the address book.

One Success
The address book objects were compiled with the speed optimization. I must not have been hitting any xpcom calls to the c++ code. The opening and closing of windows must have been all js and xul code.

I'm looking through the c++ code to see what functions are available. I am going to try and profile to hit these functions. I also am trying to enable speed optimizations for the entire mail.dll in the Makefile in the mail.dll directory. This might not work.

Note:
I also notice that when I turn on PGO for Thunderbird that all the modules get the default optimization which is the size optimization.

I will have to build a non-pgo build of Thunderbird to see if it makes a difference.

Thursday, December 4, 2008

Optimizing the Thunderbird Address Book.

I did a quick edit for the Makefile.in file for the address book in the Thunderbird source. I was hoping this would enable pgo for this module.

Here is the diff for the changes I made.

I was able to successfully build thunderbird with these options but during the profiling no optimization data was collected. If data is collected a .pgc file is created. This library is added into the mail.dll so a mail.pgc file should have been created. None was.

I haven't looked at my build output to confirm that the library and mail.dll were compiled with the optimizations. I did notice that mail.dll library was compiled with the instrumental option. This means the mail.dll had the extra instructions to collect profile data. It is possible that my profiling did not actual affect the address book.

I hope to get some more information before my 0.3 is released.

Tuesday, December 2, 2008

Patch Review Process

I've had my patch posted for about a week and still haven't not had a review. So I decided to jump on IRC and try and ask for a review.

My Project is PGO and apparently there is only one guy who owns that sort of code, Ted Mielczarek. I sent a private message to Ted and an open message on the #maildev channel to see if I could get a review. Ted responded that he is working on his review queue and would be getting to my patch. On the #maildev channel Standard8 pointed me to Ted.

So it all rests with Ted.

I was nervous posting on IRC or messaging Ted because I still don't understand the etiquette of that sort of thing. But everyone responded nicely which makes me feel better.

This experience with IRC is helping me feel better about asking questions from people I don't know.