On Wed, Sep 3, 2008 at 9:31 AM, Phil Dawes <[EMAIL PROTECTED]> wrote:
> Hi Slava,
>
> Thanks very much for your mail and for taking a look at this - I'm
> looking forward to investigating the new optimizer tonight.
>
> (N.B. I wrote the rest of this mail last night so it doesn't take into
> account your last email.)
> ----
>
> As far as I can see GC doesn't get called within a basic block, so as an
> experiment I re-implemented count-items using some custom intrinsics
> words which effectively unbox the variables involved:
>
> untag-fixnum
> unbox-alien
> fetch32-unboxed
> +4-unboxed
>
> I also used words with existing intrinsics: eq?

Now *that's* evil :-) I'm glad that the compiler internals were easy
enough to understand for someone to be able to pull this off.

> I was able to get down to 338ms for count-items after these mods.

The remaining difference between Factor and C can be attributed to
poor register allocation in the backend.

So you can see the compiler has some fundamental limitations right
now. It simply cannot complete with C, even when all the dynamic
dispatch and boxing has been eliminated. I will return to working on
the compiler some time soon and this benchmark will be one of the ones
I try to optimize. There is no reason that we cannot be as fast as C
for a task like this.

Slava

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Factor-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to