xlib functions seems slow

Christian Lynbech christian at defun.dk
Sat Feb 1 06:39:00 UTC 2003


I have been playing around with latest eclipse from the CVS repository
and have stumbled across a strange behaviour.

I have defined a small function to return all applications:

(defun application-list ()
  "Return the applications objects as a list."
  (loop for val being each hash-value in *widget-table*
	  when (and (application-p val) (application-master val)) collect val))

and another to extract their names:

(defun application-name (app)
  (xlib:wm-name (widget-window app)))

The first one is fast enough:

    * (compile 'application-list)
    Compiling LAMBDA NIL: 
    Compiling Top-Level Form: 
    APPLICATION-LIST
    NIL
    NIL
    * (time (application-list))
    Compiling LAMBDA NIL: 
    Compiling Top-Level Form: 
    Evaluation took:
      0.0 seconds of real time
      0.0 seconds of user run time
      0.0 seconds of system run time
      0 page faults and
      112 bytes consed.
    (#<APPLICATION {4804822D}> #<APPLICATION {4804832D}> 
     #<APPLICATION {4810B105}> #<APPLICATION {4810B1F5}> 
     #<APPLICATION {4804854D}> #<APPLICATION {4810BFB5}> 
     #<APPLICATION {480485ED}> #<APPLICATION {481087A5}> 
     #<APPLICATION {4804865D}> #<APPLICATION {480485AD}> 
     #<APPLICATION {4810B2E5}> #<APPLICATION {4810B015}> 
     #<APPLICATION {4810C0A5}>)
    * 

but extracting the name is extraordinaryly slow:

    * (setq x (car *))
    #<APPLICATION {4804822D}>
    * (compile 'application-name)
    Compiling LAMBDA (APP): 
    Compiling Top-Level Form: 
    APPLICATION-NAME
    NIL
    NIL
    * (time (application-name x))
    Compiling LAMBDA NIL: 
    Compiling Top-Level Form: 
    Evaluation took:
      1.02 seconds of real time
      0.0 seconds of user run time
      0.0 seconds of system run time
      4 page faults and
      760 bytes consed.
    "((HELP))"
    :STRING
    8
    0

it consistently takes a full second to retrieve the name and that
makes me suspicious that there is something I am not aware of in
CMUCL's multiprocessing and/or the interfacing with CLX.

The CMUCL is 18d, debian package version 3.1.6 and with feature list

(:CLX-MIT-R5 :CLX-MIT-R4 :XLIB :CLX :CLX-LITTLE-ENDIAN :GRAY-STREAMS :ASDF
 :MK-DEFSYSTEM :COMMON-LISP-CONTROLLER :PCL-STRUCTURES :PORTABLE-COMMONLOOPS
 :PCL :PYTHON :GENCGC :RANDOM-MT19937 :MP :HASH-NEW :COMPLEX-FLOAT
 :SIGNED-ARRAY :CMU18D :CMU18 :DIRECT-SYSCALL :RELATIVE-PACKAGE-NAMES
 :LINKAGE-TABLE :X86 :LINUX :GLIBC2 :UNIX :COMMON :CMU :NEW-COMPILER
 :COMMON-LISP :ANSI-CL :IEEE-FLOATING-POINT)

Does anybody have any ideas?


------------------------+-----------------------------------------------------
Christian Lynbech       | email: christian at defun.dk
------------------------+-----------------------------------------------------
Hit the philistines three times over the head with the Elisp reference manual.
                                        - petonic at hal.com (Michael A. Petonic)



More information about the eclipse-devel mailing list