[Sugar-devel] performance issues with Easeljs

Walter Bender walter.bender at gmail.com
Sat Jun 25 14:54:26 EDT 2016


https://github.com/walterbender/turtleblocksjs/tree/speed-tests is there
branch where I create a separate shape for each line and cache as I go
along. Helps when drawing lines that don't overlap very much but slows
things down even more when there is a lot of overlap.

-walter

On Sat, Jun 25, 2016 at 2:51 PM, Walter Bender <walter.bender at gmail.com>
wrote:

>
>
> On Sat, Jun 25, 2016 at 10:30 AM, Sahil Hindwani Hindwani <
> iit2014088 at iiita.ac.in> wrote:
>
>> Hi,
>> i am new to opensource.Can anyone guide me on how should i approach.
>>
>
> Maybe you can clone my repo [1] (I'll also push the branch where I have
> been experimenting with speed ups) and see if you can figure out some
> better way of rendering from the Turtle. All the relevant code will be in
> turtle.js.
>
>  Any help/ideas much appreciated.
>
> -walter
>
> [1] https://github.com/walterbender/turtleblocksjs
>
>>
>> On Sat, Jun 25, 2016 at 7:00 PM, Walter Bender <walter.bender at gmail.com>
>> wrote:
>>
>>> I agree that I could/should use more HTML rather than depend on Easel
>>> for everything. But that doesn't seem to be related to the issues I am
>>> experiencing.
>>>
>>> I've tried numerous combinations of caching, layering of shapes,
>>> breaking up large elements, etc. Many help in some circumstances but lead
>>> to serious degradation in others. I will step away from it for a bit and
>>> hopefully come back with fresh eyes.
>>>
>>> -walter
>>>
>>> On Sat, Jun 25, 2016 at 9:17 AM, Lionel Laské <lionel.laske at gmail.com>
>>> wrote:
>>>
>>>>
>>>> One other issue could be that everything (menus, palettes, blocks,
>>>> drawing, ...) in TurtleJS are drawing objects. So you don't use any HTML
>>>> elements that the browser is probably optimized to handle.
>>>> I guess it could be more efficient to don't rely only on Easeljs/Canvas
>>>> but also to mix it with true HTML elements like buttons, images, ...
>>>>
>>>>             Lionel.
>>>>
>>>>
>>>>
>>>> 2016-06-22 23:01 GMT+02:00 <sugar-devel-request at lists.sugarlabs.org>:
>>>>
>>>>>
>>>>>
>>>>> I've been using Easeljs for Turtle Blocks JS and have for the most part
>>>>> been ignoring the performance issues. It works really well for
>>>>> separating
>>>>> the blocks, buttons, etc. from the actual graphics drawn by the
>>>>> Turtle. But
>>>>> I am at the point where the turtle graphics performance is not
>>>>> adequate.
>>>>>
>>>>> The problem is, each time I draw, the accumulated rendering gets
>>>>> redrawn,
>>>>> so over time, the turtle crawls along. Further, even when I first start
>>>>> drawing, the performance is more than 100% slower than drawing
>>>>> directly to
>>>>> the canvas.
>>>>>
>>>>> I'm doing what I think it recommended practice by Easeljs:
>>>>>
>>>>> turtleCanvas = new createjs.Shape();
>>>>> stage.addChild(turtleCanvas);
>>>>>
>>>>> various calls of the sort:
>>>>>
>>>>> turtleCanvas.graphics.moveTo
>>>>> turtleCanvas.grpahics.lineTo
>>>>>
>>>>> I've trted using cache to cache the shape, but that seems to be even
>>>>> slower.
>>>>>
>>>>> Just writing to the canvas context is much faster, but I don't know
>>>>> how to
>>>>> combine the two worlds.
>>>>>
>>>>> Any suggestions?
>>>>>
>>>>> The code in question is in turtle.js in
>>>>> github.com/walterbender/turtleblocksjs/js
>>>>>
>>>>> -walter
>>>>>
>>>>>
>>>> _______________________________________________
>>>> Sugar-devel mailing list
>>>> Sugar-devel at lists.sugarlabs.org
>>>> http://lists.sugarlabs.org/listinfo/sugar-devel
>>>>
>>>>
>>>
>>>
>>> --
>>> Walter Bender
>>> Sugar Labs
>>> http://www.sugarlabs.org
>>> <http://www.sugarlabs.org>
>>>
>>> _______________________________________________
>>> Sugar-devel mailing list
>>> Sugar-devel at lists.sugarlabs.org
>>> http://lists.sugarlabs.org/listinfo/sugar-devel
>>>
>>>
>>
>
>
> --
> Walter Bender
> Sugar Labs
> http://www.sugarlabs.org
> <http://www.sugarlabs.org>
>



-- 
Walter Bender
Sugar Labs
http://www.sugarlabs.org
<http://www.sugarlabs.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20160625/e15b6033/attachment.html>


More information about the Sugar-devel mailing list