Re: Optimizing ‘string=’

2010-06-22 Thread Mike Gran
> From: Ludovic Courtès l...@gnu.org > Oops, there was a thinko in the patch, whereby wide strings would not > be entirely compared.  Here’s an updated one: Looks good to me. Perhaps skip the memcmp if the string lengths are zero?  At some point probably should replace all hardcoded '4' in li

Re: Optimizing ‘string=’

2010-06-22 Thread Ludovic Courtès
Hi, Andy Wingo writes: > On Tue 22 Jun 2010 21:40, l...@gnu.org (Ludovic Courtès) writes: > >> @@ -1168,6 +1168,21 @@ SCM_DEFINE (scm_string_eq, "string=", 2, 4, 0, >> "value otherwise.") >> #define FUNC_NAME s_scm_string_eq >> { >> + if (SCM_LIKELY (scm_i_is_narrow_string (s1) == sc

Re: Optimizing ‘string=’

2010-06-22 Thread Andy Wingo
Hi, Nice profile-driven debugging :) On Tue 22 Jun 2010 21:40, l...@gnu.org (Ludovic Courtès) writes: > @@ -1168,6 +1168,21 @@ SCM_DEFINE (scm_string_eq, "string=", 2, 4, 0, > "value otherwise.") > #define FUNC_NAME s_scm_string_eq > { > + if (SCM_LIKELY (scm_i_is_narrow_string (s1)

Re: Optimizing ‘string=’

2010-06-22 Thread Ludovic Courtès
Oops, there was a thinko in the patch, whereby wide strings would not be entirely compared. Here’s an updated one: diff --git a/libguile/srfi-13.c b/libguile/srfi-13.c index c4e8571..f29ceaa 100644 --- a/libguile/srfi-13.c +++ b/libguile/srfi-13.c @@ -1,6 +1,6 @@ /* srfi-13.c --- SRFI-13 procedu

Optimizing ‘string=’

2010-06-22 Thread Ludovic Courtès
Hello! While profiling a Scheme program, I noticed that ‘string=?’ was surprisingly high. I ran OProfile on this Scheme program: --8<---cut here---start->8--- (define s (make-string 123 #\a)) (let loop () (string= s s) (loop)) --8<---cut here--

Re: Lambda efficiency

2010-06-22 Thread Andy Wingo
Heya, On Tue 22 Jun 2010 21:18, Michael Lucy writes: > I'm generating some code, and I was wondering if: > ((lambda (x) (* x 2)) 3) > is significantly less efficient than: > (* 3 2) ((lambda (x) y) z) is reduced to (let ((x z)) y) at compile-time. We don't inline x yet, though we will soon. Ve

Lambda efficiency

2010-06-22 Thread Michael Lucy
Hey, I'm generating some code, and I was wondering if: ((lambda (x) (* x 2)) 3) is significantly less efficient than: (* 3 2) or if the Guile compiler will take care of that for me (the expression is going to be evaluated a lot).

Re: Troubles with Objcode and Storing JIT Pointers

2010-06-22 Thread Andy Wingo
On Tue 22 Jun 2010 00:23, Noah Lavine writes: > If I may ask, do you already have patches or a git branch that adds [a > native code slot to objcode]? If so, what are you doing about the > embedded objcode issue? (Changing the bytecode to leave room for it, > or hiding the slot in the C code?) I

Re: guile prolog benchmark

2010-06-22 Thread stefan
On Tuesday 22 June 2010 01:49:59 pm Ludovic Courtès wrote: > Hi Stefan, > > stefan writes: > > http://gitorious.org/guile-unify/ > > > > I think it's a good start. Also I will try to make a less rude > > version of it. Until then you would not like to merge that code. > > so it is best to keep it

Re: r6rs library documentation

2010-06-22 Thread Ludovic Courtès
Hi Julian, Julian Graham writes: >> Sounds great to me, though Brian & Neil can always come in to correct me >> :) > > Done! See commit ea28e981342fd1d381e489e57cddde97eb390442. In > addition to the main .texi payload, I adjusted the formatting on some > of your initial paragraphs and removed

Re: guile prolog benchmark

2010-06-22 Thread Ludovic Courtès
Hi Stefan, stefan writes: > http://gitorious.org/guile-unify/ > > I think it's a good start. Also I will try to make a less rude > version of it. Until then you would not like to merge that code. > so it is best to keep it in "playground" for some time. What justifies such a tight coupling with

Re: guile prolog benchmark

2010-06-22 Thread stefan
On Monday 21 June 2010 11:58:18 pm Ludovic Courtès wrote: > Hello, > > Sounds fun. Is the Prolog-on-Guile code available on-line? > > Thanks, > Ludo’. > http://gitorious.org/guile-unify/ I think it's a good start. Also I will try to make a less rude version of it. Until then you would not lik