Re: profiling GJS/Clutter.Timeline vs Mainloop.timeout_add



On 5 June 2012 11:29, Jasper St. Pierre <jstpierre mecheye net> wrote:
> On Mon, Jun 4, 2012 at 9:09 PM, Amy C <mathematical coffee gmail com> wrote:
>> Should I use a Clutter.Timeline for this instead? I like
>> Mainloop.timeout_add because it allows me to specify the time between
>> frames and suits a frame-driven animation, whereas a Clutter.Timeline
>> seems more suited to an animation where you just want it to transition
>> from state A to state B in x milliseconds, however many frames happen
>> to fit in that.
>
> The point of frame-driven animation is that you don't care about the
> time between frames. You can use a repaint func
> (Clutter.threads_add_repaint_func IIRC), or a timeline with a very
> long duration to get a function called on a frame tick.
>
>> Continuing on from that, is there some tool by which I can profile GJS
>> code? I know there are plenty for JS code but I'm not sure how to
>> write my code to run standalone what with the various imports
>> (.gi.{heaps| & .lang, .mainloop), or even if that is possible.
>
> It's not the JS code that's slowing you down. While Clutter uses the
> GLib Mainloop, it has specialized needs, so a Mainloop-style approach
> won't really work.
>
OK, thanks. Mainloop was handy for slowing the animation down for
debugging (I had each toon logging what they were doing to stdout
every frame), but I'll switch to timeline or threads_add_repaint_func
(hadn't heard of the latter, I'll go check it out).


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]