CPU usage
Posted: Sat Nov 24, 2007 10:15 pm
I using gs:check-event with the (gs:get-bounds) call every 100 millisecs to know if canvas has resized.
In my system (AMD Turion 64, Debian 64 bit) newlisp, runned with guiserver uses ~55% CPU for newlisp and ~45% CPU for java.
The CPU's adaptive fan is trying to fly away from the box :-)
Can this be optimized?
sample code:
In my system (AMD Turion 64, Debian 64 bit) newlisp, runned with guiserver uses ~55% CPU for newlisp and ~45% CPU for java.
The CPU's adaptive fan is trying to fly away from the box :-)
Can this be optimized?
sample code:
Code: Select all
(load (append (env "NEWLISPDIR") "/guiserver.lsp"))
(gs:init)
;;;; describe the GUI
(gs:frame 'PFrame 100 100 600 600 "Frame")
(gs:set-border-layout 'PFrame)
(gs:canvas 'Picture)
(gs:set-background 'Picture gs:white)
(gs:add-to 'PFrame 'Picture "center")
(gs:set-visible 'PFrame true)
(define (bounds)
(2 (gs:get-bounds 'Picture)))
(define (handle-resize)
(set 'new-bounds (bounds)))
(while (gs:check-event 100000) ; check for 10 milli seconds
(handle-resize))