On Friday 10 December 2004 16:30, Wendell Turner wrote:
> Graphics programs using the latest version of the toolkit
> (cvs/v11) seem to be very cpu-intensive (at least on fedora and
> redhat installations). Typical cpu utilization rates are
> 40%-45% for the program itself, and 50-55% for X. (Without the
> Unicon graphics program running, X typically uses about 3%)
>
This certainly shouldn't be the case...cpu usage should be tiny for a program
which isn't doing anything in particular (event handling, repainting, or
running a ticker function).
> Those programs compiled with previous version of the toolkit
> were not nearly so cpu-intensive. Any clues as to what is
> causing this? Where should I look inside the toolkit to track
> down such high cpu usages?
>
Could you try running the attached program with tracing on...
$ TRACE=-1 prog &>res
then kill it with ^C. res should (after the initial setup) contain a
repeating sequence of lines like
ispatcher.icn: 141 | | | gui__Dispatcher_do_event(record
gui__Dispatcher__state_1(record gui__Dispatcher__state_1(7),recor
d gui__Dispatcher__methods_1(23),set_1(1),set_2(0),50,10,50))
ispatcher.icn: 168 | | | gui__Dispatcher_do_event failed
ispatcher.icn: 141 | | | gui__Dispatcher_do_validate(record
gui__Dispatcher__state_1(record gui__Dispatcher__state_1(7),re
cord gui__Dispatcher__methods_1(23),set_1(1),set_2(0),50,10,50))
ispatcher.icn: 174 | | | | gui__Dialog_needs_validate(record
Untitled__state_1(record Untitled__state_1(55),record Untitle
d__methods_1(159),window_1:1(),1,&null,set_4(0),&null,&null,&null,window_2:2
(),&null,&null,&null,500,500,100,&null,&null,&nu
ll,&null,&null,&null,&null,&null,&null,&null,list_12 =
[],1,&null,&null,&null,&null,"l","t",0,0,170,146,record Untitled__sta
te_1(55),list_14(1),&null,&null,window_1:3(),window_2:4
(),&null,&null,&null,&null,list_10(1),1,&null,&null,&null,record gui_
_Ticker__state_1(5),list_4 = []))
dialog.icn : 59 | | | | gui__Dialog_needs_validate failed
ispatcher.icn: 181 | | | gui__Dispatcher_do_validate failed
ispatcher.icn: 141 | | | gui__Dispatcher_do_ticker(record
gui__Dispatcher__state_1(record gui__Dispatcher__state_1(7),reco
rd gui__Dispatcher__methods_1(23),set_1(1),set_2(0),50,10,50))
ispatcher.icn: 186 | | | | gui__Dispatcher_curr_time_of_day(record
gui__Dispatcher__state_1(record gui__Dispatcher__state_
1(7),record gui__Dispatcher__methods_1(23),set_1(1),set_2(0),50,10,50))
ispatcher.icn: 70 | | | | gui__Dispatcher_curr_time_of_day returned
1102697491697
ispatcher.icn: 201 | | | gui__Dispatcher_do_ticker failed
ispatcher.icn: 141 | | | gui__Dispatcher_sleep(record
gui__Dispatcher__state_1(record gui__Dispatcher__state_1(7),record g
ui__Dispatcher__methods_1(23),set_1(1),set_2(0),50,10,50),50)
ispatcher.icn: 115 | | | gui__Dispatcher_sleep failed
The sleep() should prevent the loop becoming a "busy" one.
Do you see anything different by any chance?
Thanks,
Robert
import gui
$include "guih.icn"
class Untitled : Dialog()
method component_setup()
self.setup()
end
method end_dialog()
end
method init_dialog()
end
method setup()
local text_button_1
self.set_attribs("size=170,146")
text_button_1 := TextButton()
text_button_1.set_pos(51, 49)
text_button_1.clear_toggles()
text_button_1.set_label("Button")
text_button_1.set_internal_alignment("c")
self.add(text_button_1)
end
initially
self.Dialog.initially()
end
procedure main()
local d
d := Untitled()
d.show_modal()
end
### Ivib-v2 layout ##
#class|Canvas|17|Name Table|table|integer|0|1|string|text_button|intege
#r|1|SuperClass Name|string|Dialog|Import Name|string|gui|Button Groups
#|class|ButtonGroupSet|2|Parent Canvas|1|Boxes|list|0|Checkbox Groups|c
#lass|CheckBoxGroupSet|2|Parent Canvas|1|Boxes|list|0|Gen Indent|intege
#r|3|Gen Main|integer|1|Gen Component Setup|integer|1|Gen Init Dialog|i
#nteger|1|Gen Initially|integer|1|Dialog Struct|class|CDialog|4|Min Wid
#th|null|Min Height|null|Ticker Rate|null|Attribs|list|0|Name|string|Un
#titled|Width|integer|170|Height|integer|146|Items|list|1|class|CanvasT
#extButton|36|Parent Canvas|1|Name|string|text_button_1|Class Name|stri
#ng|TextButton|Import Name|string|gui|X Fix|null|Y Fix|null|W Fix|null|
#H Fix|null|W Default|integer|1|H Default|integer|1|X Spec|integer|51|Y
# Spec|integer|49|W Spec|integer|52|H Spec|integer|23|X Align|string|l|
#Y Align|string|t|Is shaded|null|Is Button Subclass|integer|1|Draw Bord
#er|null|Attribs|list|0|Tooltip|null|Accel|null|Event Handlers|null|Cla
#ss Variable|null|Parent Component|1|Label|string|Button|No Keyboard|nu
#ll|Img Up|null|Img Down|null|Img Width|null|Img Height|null|Is Checked
# Flag|null|Is Checkbox Flag|null|Parent CheckBoxGroup|null|Parent Butt
#on Group|null|Internal Align|string|c|Initial Focus|null|Event Handler
#s|null|