From: Mikael Djurfeldt <mikael@djurfeldt.com>
To: Stefan Israelsson Tampe <stefan.itampe@gmail.com>
Cc: guile-user <guile-user@gnu.org>
Subject: Re: GOOPS question
Date: Fri, 30 Apr 2021 17:15:03 +0200 [thread overview]
Message-ID: <CAA2XvwKoAA804PzNkmqV-=W4oZNrougGHwuxArpr8e2_4WJO+Q@mail.gmail.com> (raw)
In-Reply-To: <CAA2XvwLATi2UWc43LUeiLNLXx6gkEqt=g_MC_ASUnVM0_9oQ9g@mail.gmail.com>
Preferably, the dispatch should be done as much as possible during compile
time such that it takes zero time during runtime.
On Fri, Apr 30, 2021 at 4:50 PM Mikael Djurfeldt <mikael@djurfeldt.com>
wrote:
> Generic method dispatch is *supposed* to be fast. It was fast once upon a
> time. We should fix that.
>
> On Fri, Apr 30, 2021 at 2:19 PM Stefan Israelsson Tampe <
> stefan.itampe@gmail.com> wrote:
>
>> If performance is important, a goops solution can be slow in vector-ref
>> and vector-set! operations due
>> to two reasons. (I have pounder an implementation of resizable python
>> lists and here is my tips),
>>
>> 1. slot-ref/slot-set! is slow (I try to fix this using the much more
>> difficult struct-ref/struct-set!)
>> 2. generic-method-dispatch is slow, I try to make a wrapper function in
>> which we short cut for
>> python/sheme internal types and if they do not match use the
>> generic method.
>>
>>
>> On Fri, Apr 30, 2021 at 1:57 PM Mikael Djurfeldt <mikael@djurfeldt.com>
>> wrote:
>>
>>> On Fri, Apr 30, 2021 at 1:11 AM Damien Mattei <damien.mattei@gmail.com>
>>> wrote:
>>>
>>> > for example in the doc there is:
>>> > (define-class <my-complex> (<number>) r i #:name "Complex")
>>> >
>>> > seems <number> superclass is of no use
>>> >
>>>
>>> Well, it certainly *is* of use in the sense that methods operating on
>>> <number> will immediately start to also accept <my-complex> as an
>>> argument.
>>> That might seem worrisome but is not if there is some agreement on which
>>> operations should be implemented for all numbers. So, if you had
>>> previously
>>> written an algorithm which operates on numbers, there's now a good chance
>>> that it would also work for <my-complex> objects.
>>>
>>
next prev parent reply other threads:[~2021-04-30 15:15 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-29 23:10 GOOPS question Damien Mattei
2021-04-30 5:52 ` Atom X
2021-04-30 7:55 ` Mikael Djurfeldt
2021-05-02 0:07 ` Damien Mattei
2021-05-02 10:14 ` Damien Mattei
2021-05-02 10:26 ` Mikael Djurfeldt
2021-05-02 10:58 ` Damien Mattei
2021-05-02 10:34 ` Damien Mattei
2021-05-02 10:35 ` tomas
2021-05-02 10:21 ` Mikael Djurfeldt
2021-05-08 21:11 ` Damien Mattei
2021-05-10 12:22 ` Mikael Djurfeldt
2021-04-30 7:57 ` Linus Björnstam
2021-04-30 9:47 ` Damien Mattei
2021-04-30 10:43 ` Mikael Djurfeldt
2021-04-30 11:08 ` Mikael Djurfeldt
2021-04-30 12:19 ` Stefan Israelsson Tampe
2021-04-30 14:50 ` Mikael Djurfeldt
2021-04-30 15:15 ` Mikael Djurfeldt [this message]
[not found] <Pine.GSO.4.05.10207071043010.9685-100000@sallust.ida.ing.tu-bs.de>
2002-07-08 18:26 ` goops question Marius Vollmer
[not found] ` <87fzyu9iu0.fsf@zagadka.ping.de>
2002-07-08 19:59 ` Dirk Herrmann
2002-07-09 21:17 ` Neil Jerram
-- strict thread matches above, loose matches on Subject: below --
2002-07-07 8:45 Dirk Herrmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAA2XvwKoAA804PzNkmqV-=W4oZNrougGHwuxArpr8e2_4WJO+Q@mail.gmail.com' \
--to=mikael@djurfeldt.com \
--cc=guile-user@gnu.org \
--cc=stefan.itampe@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).