Re: [Sugar-devel] MANIFEST experiments
On Sun, Nov 08, 2009 at 02:29:51PM +0700, Philipp Kocher wrote: The patch is good to reduce the boot time, but doesn't work for activity developers. Yes, this is a known side-effect. It is an optimisation for users not developers. -- James Cameron http://quozl.linux.org.au/ ___ Devel mailing list Devel@lists.laptop.org http://lists.laptop.org/listinfo/devel
Re: [Sugar-devel] MANIFEST experiments
The patch is good to reduce the boot time, but doesn't work for activity developers. After applying the patch I run setup.py dist_xo of an activity and got the following error (since read_manifest is supposed to set self.manifest and doesn't do it anymore): Traceback (most recent call last): File ./setup.py, line 3, in module bundlebuilder.start() File /usr/lib/python2.5/site-packages/sugar/activity/bundlebuilder.py, line 493, in start globals()['cmd_' + args[0]](config, args[1:]) File /usr/lib/python2.5/site-packages/sugar/activity/bundlebuilder.py, line 284, in cmd_dist_xo packager.package() File /usr/lib/python2.5/site-packages/sugar/activity/bundlebuilder.py, line 184, in package missing_files = self.builder.check_manifest() File /usr/lib/python2.5/site-packages/sugar/activity/bundlebuilder.py, line 147, in check_manifest if path not in self.config.bundle.manifest: TypeError: argument of type 'NoneType' is not iterable Regards, Philipp James Cameron wrote: Confirmed. On Wed, Oct 14, 2009 at 05:29:09PM +0545, Daniel Drake wrote: So, I reflashed 2 XOs, booted for the first time, entered a name. On one, I modified sugar.bundle.ActivityBundle.read_manifest() to be a no-op, then turned it off. On the other, I just turned it off. I reproduced this experiment. Used build 802, with a limited set of 22 activities [1], with a similar change [2]. Then I powered both on at the same time and started a stopwatch. I measured how long it takes for the XOs to reach the stage of boot where the XO stick figure and the activity icons are visible. 1255565448 power up both XOs 1255565533 modified XO boot complete 1255565539 unmodified XO boot complete The one with the modification reached this point *55* seconds faster than the other one! In my case, about 6 seconds. I feel that even this small time was worth it, so I plan to patch this for the friends' kids I've got laptops deployed to. Is there a collection of 802 performance improvement patches? Notes: 1. the activities installed were from G1G1 Activities for 8.2 and were Browse Calculate Chat Distance Etoys Implode Maze Measure Memorize Moon Paint Pippy Read Record Ruler Scratch Speak TamTamMini TamTamSynthLab Terminal TurtleArt Write 2. the change was to activitybundle.py in /usr/lib/python2.5/site-packages/sugar/bundle/ and removed all code in read_manifest(), leaving just pass: def read_manifest(self): pass ___ Devel mailing list Devel@lists.laptop.org http://lists.laptop.org/listinfo/devel ___ Devel mailing list Devel@lists.laptop.org http://lists.laptop.org/listinfo/devel
Re: [Sugar-devel] MANIFEST experiments
On 14.10.2009, at 13:44, Daniel Drake wrote: Today I ran a quick experiment on OLPC OS v8.2.1, based on the question: what are the activity MANIFEST files used for? I see sugar frequently complaining about MANIFEST inconsistencies in the logs, but I don't recall seeing it act on these inconsistencies in any way. I noticed that it even logs such inconsistencies during startup, meaning that it must be checking every file in every activity during a regular boot... So, I reflashed 2 XOs, booted for the first time, entered a name. On one, I modified sugar.bundle.ActivityBundle.read_manifest() to be a no-op, then turned it off. On the other, I just turned it off. Then I powered both on at the same time and started a stopwatch. I measured how long it takes for the XOs to reach the stage of boot where the XO stick figure and the activity icons are visible. The one with the modification reached this point *55* seconds faster than the other one! It basically zeroes the time where you can see the XO stick figure on screen but the activity icons on the home view have yet to appear. This was using OLE Nepal's customized build which includes a big activity with many manifest errors, so the difference might be less elsewhere. Tomeu points out that this behaviour has been improved in more recent sugar versions to the point where manifest checking probably is not happening in the startup path, but personally I question why we are even checking at all. Perhaps we should rip out all that code and leave MANIFESTs purely as a tool for developers to specify which files get included in a bundle or something like that. I did indeed think that's the entire purpose of it. - Bert - ___ Devel mailing list Devel@lists.laptop.org http://lists.laptop.org/listinfo/devel
Re: [Sugar-devel] MANIFEST experiments
Confirmed. On Wed, Oct 14, 2009 at 05:29:09PM +0545, Daniel Drake wrote: So, I reflashed 2 XOs, booted for the first time, entered a name. On one, I modified sugar.bundle.ActivityBundle.read_manifest() to be a no-op, then turned it off. On the other, I just turned it off. I reproduced this experiment. Used build 802, with a limited set of 22 activities [1], with a similar change [2]. Then I powered both on at the same time and started a stopwatch. I measured how long it takes for the XOs to reach the stage of boot where the XO stick figure and the activity icons are visible. 1255565448 power up both XOs 1255565533 modified XO boot complete 1255565539 unmodified XO boot complete The one with the modification reached this point *55* seconds faster than the other one! In my case, about 6 seconds. I feel that even this small time was worth it, so I plan to patch this for the friends' kids I've got laptops deployed to. Is there a collection of 802 performance improvement patches? Notes: 1. the activities installed were from G1G1 Activities for 8.2 and were Browse Calculate Chat Distance Etoys Implode Maze Measure Memorize Moon Paint Pippy Read Record Ruler Scratch Speak TamTamMini TamTamSynthLab Terminal TurtleArt Write 2. the change was to activitybundle.py in /usr/lib/python2.5/site-packages/sugar/bundle/ and removed all code in read_manifest(), leaving just pass: def read_manifest(self): pass -- James Cameron http://quozl.linux.org.au/ --- activitybundle.py.orig 2009-10-15 00:09:04.0 + +++ activitybundle.py 2009-10-15 00:09:40.0 + @@ -79,43 +79,7 @@ return ret def read_manifest(self): -read_manifest: sets self.manifest to list of lines in MANIFEST, -with invalid lines replaced by empty lines. - -Since absolute order carries information on file history, it should -be preserved. For instance, when renaming a file, you should leave -the new name on the same line as the old one. - -lines = self._raw_manifest() - -# Remove trailing newlines, they do not help keep absolute position. -while lines and lines[-1] == : -lines = lines[:-1] - -for num, line in enumerate(lines): -if not line: -continue - -# Remove duplicates -if line in lines[0:num]: -lines[num] = -logging.warning(Bundle %s: duplicate entry in MANIFEST: %s -% (self._name,line)) -continue - -# Remove MANIFEST -if line == MANIFEST: -lines[num] = -logging.warning(Bundle %s: MANIFEST includes itself: %s -% (self._name,line)) - -# Remove invalid files -if not self.is_file(line): -lines[num] = -logging.warning(Bundle %s: invalid entry in MANIFEST: %s -% (self._name,line)) - -self.manifest = lines + pass def get_files(self, manifest = None): files = [line for line in (manifest or self.manifest) if line] ___ Devel mailing list Devel@lists.laptop.org http://lists.laptop.org/listinfo/devel