Hi all.

Here is an excerpt from a chicken-profile for one of my programs:

procedure                                  calls   seconds   average  percent
-------------------------------------------------------------------------------
...
symbol-compare                         1058128414  3467.563     0.277  13.7471
...

I was surprised by the high percentage for symbol-compare
which I don't see with other Schemes:

(define symbol-compare (lambda (a b)
  (string-compare (symbol->string a) (symbol->string b))))

(define string-compare string-compare3) ; for example

I looked at the definition of symbol->string and found out
that it is not a constant operation (like returning some pointer)
but constructs a string.
Does anyone have a more efficient comparison of symbols implemented?

BTW: the average above is wrong
(because of format-real in chicken-profile.scm).

Greetings
Sven

Attachment: pgpHQI5pyVAHL.pgp
Description: PGP signature

_______________________________________________
Chicken-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to