[Top][All Lists]

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

Re: debugging GUI performance

From: Rik
Subject: Re: debugging GUI performance
Date: Mon, 21 Oct 2013 11:03:26 -0700

On 10/20/2013 08:42 AM, Michael Goffioul wrote:
> On Sun, Oct 20, 2013 at 11:23 AM, Rik <address@hidden> wrote:
>     10/20/13
>     Michael,
>     So I did that, and sure enough there are tens to hundreds of calls to draw_image as the mouse is moved over the canvas.
>     It seems that __fltk_redraw__ in __init_fltk__.cc:1860 is called whenever there is an event (like a mouse movement) in the FLTK window.  __fltk_redraw__ then goes ahead and redraws each object in the figure including the axes and children.  GUIs aren't really my area, but it seems like we should be checking the event type and possibly ignoring the trivial ones.
> I'm not familiar with FLTK (I didn't write the FLTK UI code), but it's sort of doing that in plot_window::handle. However, I can see that moving the mouse triggers a redraw of the status bar and I'm wondering if that's not what is causing the full redraw. Could you check a backtrace to see where is the redraw coming from?


The backtrace seems to be coming from an input_event_hook that __init_fltk__ sets up to call F__fltk_redraw__ periodically.  When F__fltk_redraw__ is called the last line of that function is Fl::check ().  This duly processes any pending window activity.  It seems like mousing over a figure is enough to initiate a window redraw.  If I enclose the Fl::check() with a test for Fl::damage() to see if any pixels have been changed then I don't get the unnecessary callbacks, but the uimenu doesn't work either.  It's not great, but we seemed to have lived with this behavior for a while so I suppose we can keep doing so.  When we switch over to Qt figures maybe this will all become easier.


#0  opengl_renderer::draw_line (this=0xcd8220, props=...) at corefcn/gl-render.cc:1425
#1  0x00007ffff7092839 in opengl_renderer::draw (this=0xcd8220, go=..., toplevel=true)
    at corefcn/gl-render.cc:556
#2  0x00007ffff7097927 in opengl_renderer::draw_axes_children (this=0xcd8220, props=...)
    at corefcn/gl-render.cc:1364
#3  0x00007ffff7097db4 in opengl_renderer::draw_axes (this=0xcd8220, props=...)
    at corefcn/gl-render.cc:1419
#4  0x00007ffff7092788 in opengl_renderer::draw (this=0xcd8220, go=..., toplevel=false)
    at corefcn/gl-render.cc:554
#5  0x00007ffff70a85c0 in opengl_renderer::draw (this=0xcd8220, hlist=..., toplevel=false)
    at corefcn/gl-render.h:73
#6  0x00007ffff70933ae in opengl_renderer::draw_figure (this=0xcd8220, props=...)
    at corefcn/gl-render.cc:592
#7  0x00007ffff70926d7 in opengl_renderer::draw (this=0xcd8220, go=..., toplevel=true)
    at corefcn/gl-render.cc:552
#8  0x00007fffe408a405 in OpenGL_fltk::draw (this=0xcd8100) at dldfcn/__init_fltk__.cc:193
#9  0x00007fffe3e442ed in Fl_Gl_Window::flush() () from /usr/lib/x86_64-linux-gnu/libfltk_gl.so.1.3
#10 0x00007fffe3b41ad2 in Fl::flush() () from /usr/lib/x86_64-linux-gnu/libfltk.so.1.3
#11 0x00007fffe3b4322c in Fl::wait(double) () from /usr/lib/x86_64-linux-gnu/libfltk.so.1.3
#12 0x00007fffe3b432cd in Fl::check() () from /usr/lib/x86_64-linux-gnu/libfltk.so.1.3
#13 0x00007fffe407fe28 in __fltk_redraw__ () at dldfcn/__init_fltk__.cc:1860
#14 0x00007fffe4080118 in F__fltk_redraw__ () at dldfcn/__init_fltk__.cc:2051
#15 0x00007ffff6e3da01 in octave_builtin::do_multi_index_op (this=0x7a0330, nargout=0, args=...,
    lvalue_list=0x0) at octave-value/ov-builtin.cc:131
#16 0x00007ffff6ee48f3 in octave_value::do_multi_index_op (this=0x78c570, nargout=0, idx=...,
    lvalue_list=0x0) at octave-value/ov.cc:1358
#17 0x00007ffff6e7cd1d in octave_fcn_handle::do_multi_index_op (this=0x78c560, nargout=0, args=...,
    lvalue_list=0x0) at octave-value/ov-fcn-handle.cc:219
#18 0x00007ffff6e7c814 in octave_fcn_handle::do_multi_index_op (this=0x78c560, nargout=0, args=...)
    at octave-value/ov-fcn-handle.cc:140
#19 0x00007ffff6ee489e in octave_value::do_multi_index_op (this=0x77bf10, nargout=0, idx=...)
    at octave-value/ov.cc:1351
#20 0x00007ffff71fc761 in fcn_handle_hook_function::eval (this=0x77bef0, initial_args=...)
    at corefcn/hook-fcn.h:170
#21 0x00007ffff7200bb2 in hook_function::eval (this=0x7fffffffbe80, initial_args=...)
    at corefcn/hook-fcn.h:105
#22 0x00007ffff7200d6f in hook_function_list::run (this=0x7ffff7a03080, initial_args=...)
    at corefcn/hook-fcn.h:251
#23 0x00007ffff71ffb2b in internal_input_event_hook_fcn () at corefcn/input.cc:1119
#24 0x00007ffff5fe11d3 in command_editor::event_handler () at util/cmd-edit.cc:1015
#25 0x00007fffeef2f5ab in rl_read_key () from /lib/x86_64-linux-gnu/libreadline.so.6
#26 0x00007fffeef1a251 in readline_internal_char () from /lib/x86_64-linux-gnu/libreadline.so.6
#27 0x00007fffeef1a795 in readline () from /lib/x86_64-linux-gnu/libreadline.so.6
#28 0x00007ffff601d1e8 in octave_rl_readline (prompt=0xdb43c8 "octave:2> ") at util/oct-rl-edit.c:190
#29 0x00007ffff5fdfdee in gnu_readline::do_readline (this=0x65d490, prompt=...,
    address@hidden: false) at util/cmd-edit.cc:274
#30 0x00007ffff5fe133a in command_editor::readline (prompt=..., address@hidden: false)
    at util/cmd-edit.cc:1046
#31 0x00007ffff71fcc2e in gnu_readline (s=..., address@hidden: false) at corefcn/input.cc:183
#32 0x00007ffff71fcdea in interactive_input (s=..., address@hidden: false)
    at corefcn/input.cc:211
#33 0x00007ffff71fcf43 in octave_base_reader::octave_gets (this=0xaf7060, address@hidden: false)
#34 0x00007ffff71fe545 in octave_terminal_reader::get_input (this=0xaf7060,
    address@hidden: false) at corefcn/input.cc:609
#35 0x00007ffff6f7c181 in octave_input_reader::get_input (this=0xb633b0, address@hidden: false)
    at corefcn/input.h:233
#36 0x00007ffff6f7bb83 in octave_lexer::fill_flex_buffer (this=0xb63120, buf=0xbd41c0 "",
    max_size=8192) at lex.ll:3220
#37 0x00007ffff6f74c39 in yy_get_next_buffer (yyscanner=0xb40b80) at parse-tree/lex.cc:3304
#38 0x00007ffff6f74651 in octave_lex (yylval_param=0x7fffffffc680, yyscanner=0xb40b80)
    at parse-tree/lex.cc:3145
#39 0x00007ffff6f81643 in octave_pull_parse (yyps=0x0, parser=...) at parse-tree/oct-parse.cc:3952
#40 0x00007ffff6f815da in octave_parse (parser=...) at parse-tree/oct-parse.cc:3922
#41 0x00007ffff6f8cfea in octave_parser::run (this=0x7fffffffc750) at oct-parse.yy:3415
#42 0x00007ffff736542a in main_loop () at corefcn/toplev.cc:567
#43 0x00007ffff6ac87f4 in octave_execute_interpreter () at octave.cc:1031
#44 0x0000000000402ca1 in main (argc=9, argv=0x7fffffffca58) at main.cc:49

reply via email to

[Prev in Thread] Current Thread [Next in Thread]