From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Mikael Djurfeldt Newsgroups: gmane.lisp.guile.user Subject: Re: GOOPS question Date: Fri, 30 Apr 2021 16:50:33 +0200 Message-ID: References: Reply-To: mikael@djurfeldt.com Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40824"; mail-complaints-to="usenet@ciao.gmane.io" Cc: guile-user To: Stefan Israelsson Tampe Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Fri Apr 30 16:51:24 2021 Return-path: Envelope-to: guile-user@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lcUUF-000ASq-UH for guile-user@m.gmane-mx.org; Fri, 30 Apr 2021 16:51:23 +0200 Original-Received: from localhost ([::1]:51428 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lcUUE-0000iV-T2 for guile-user@m.gmane-mx.org; Fri, 30 Apr 2021 10:51:22 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35680) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lcUTg-0000QF-Qi for guile-user@gnu.org; Fri, 30 Apr 2021 10:50:49 -0400 Original-Received: from mail-ua1-f45.google.com ([209.85.222.45]:36748) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lcUTe-0001De-I5 for guile-user@gnu.org; Fri, 30 Apr 2021 10:50:48 -0400 Original-Received: by mail-ua1-f45.google.com with SMTP id x9so14446798uao.3 for ; Fri, 30 Apr 2021 07:50:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=Dig4fCJmtabkFIGfu0wNYjDuuIdbPUDRZ64yRa9whMA=; b=k7V256WkwSuvsMxHQirgp+Jb8w6xraJ8UHU1qZnZQDDyXktjX7mNcbXJMtaa+wFe8Y Ot2cxDsHMFLNJFRWRw+J3fhbhDtwPann5Xf2KZ9ceTjMJbRVxkKtyzolEZ+9EIgjquGm FGoKdf8RwvuHC87YVmoAl7vKcDOEmRuGFkxWrNkYsSvRyvMFIW9vcY8if+HCx5eCoIFi r1n2c3LYLetrnx9y8B6CPP6qPZvGNia5kEsG9dmcl38KnDYS7L+CdSqpruQ0Ibt3tdlS 2vhbGyKcG+Kp9l8lrK9+JHD9c8cKWpRAKPBDf+F47SDV+4OPN80QJv9Ru5CSpYwY7cMk UgXQ== X-Gm-Message-State: AOAM531sTYoWfXQfEMvIuJmS5sI2tZteBN42KYDM/2eaehMO+9i10rne 8Pthi0d7BpP9jTpWLayp1cyOFDfpPK7JYXltBBY= X-Google-Smtp-Source: ABdhPJzXmWX25n1pJ95rggXQdNeGxCrNw4pi0c1Fozvsupq0hRj/nOSvXgDZefgjTQK8Kc7Xakr1+r21z047wpgO8iM= X-Received: by 2002:ab0:5909:: with SMTP id n9mr5154756uad.79.1619794244640; Fri, 30 Apr 2021 07:50:44 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=209.85.222.45; envelope-from=mdjurfeldt@gmail.com; helo=mail-ua1-f45.google.com X-Spam_score_int: -13 X-Spam_score: -1.4 X-Spam_bar: - X-Spam_report: (-1.4 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.io gmane.lisp.guile.user:17490 Archived-At: 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 > wrote: > >> On Fri, Apr 30, 2021 at 1:11 AM Damien Mattei >> wrote: >> >> > for example in the doc there is: >> > (define-class () r i #:name "Complex") >> > >> > seems superclass is of no use >> > >> >> Well, it certainly *is* of use in the sense that methods operating on >> will immediately start to also accept 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 objects. >> >