[Sugar-devel] Web activity example that uses html5 canvas

Manuel Quiñones manuq at laptop.org
Wed May 1 22:36:49 EDT 2013


Great summary James,

2013/4/30 James Cameron <quozl at laptop.org>:
> Summary: this Clock activity consumes significantly less CPU on XO-4
> and XO-1 when implemented in Javascript.
>
> On Tue, Apr 30, 2013 at 08:42:18PM -0300, Manuel Qui?ones wrote:
>> 2013/4/30 James Cameron <quozl at laptop.org>:
>> > On Tue, Apr 30, 2013 at 08:58:50AM -0300, Manuel Qui?ones wrote:
>> >> Should work on other browsers now:
>> >>
>> >> http://manuq.github.io/clockjs/
>> >
>> > Agreed, works well, reasonably low CPU utilisation.  Thanks.
>>
>> Excellent.  Thanks for checking the CPU consumption.
>
> Here's a more detailed check.  Method is to run only the activity
> under test, and use the serial port to run the Linux top command
> configured for a 30 second sample time.
>
> --
>
> On XO-4 using 13.1.0:
>
> - using Javascript, the Browse-149 process consumes 7.5% CPU, and the
>   X process 3.2% CPU.  Total of 10.7% CPU.
>
> - not using Javascript, the Clock-12 process consumes 2.7% CPU, and
>   the X process 13.2% CPU.  Total of 15.9% CPU.
>
> (Were there any changes to the algorithm?  e.g. is the Sugar activity
> drawing more frequently than the Javascript activity?)

Both do the update at the same rate, one second.  But Clock-12 is
redrawing the background on each update, which is unnecessary.  I
fixed that a while ago in the master branch:

"Draw the simple background only when the widget resizes - SL #1959"
https://git.sugarlabs.org/clock/mainline/commit/5ec58d240ab99e3268f85ba31c1ed0ee99f78260

So the next release of Clock will be a more fair comparison.

Also I think installing the javascript clock as an activity will
provide a better test than running it inside Browse.  It is possible
in Sugar master branch, but is not in any olpc build yet.

--
.. manuq ..


More information about the Sugar-devel mailing list