[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Chicken-users] symbol->string
From: |
Sven . Hartrumpf |
Subject: |
[Chicken-users] symbol->string |
Date: |
Mon, 23 Oct 2006 10:07:04 +0200 (CEST) |
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
pgpA7MIChuCsc.pgp
Description: PGP signature
- [Chicken-users] symbol->string,
Sven . Hartrumpf <=