From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Israelsson Tampe Newsgroups: gmane.lisp.guile.devel,gmane.lisp.guile.user Subject: C based vector and bytevector copy Date: Thu, 3 Feb 2022 08:08:46 +0100 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000d161a605d717ceea" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12505"; mail-complaints-to="usenet@ciao.gmane.io" To: guile-devel , Guile User Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Thu Feb 03 08:10:27 2022 Return-path: Envelope-to: guile-devel@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 1nFWGA-000320-VL for guile-devel@m.gmane-mx.org; Thu, 03 Feb 2022 08:10:26 +0100 Original-Received: from localhost ([::1]:51404 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nFWG9-0001UC-9B for guile-devel@m.gmane-mx.org; Thu, 03 Feb 2022 02:10:25 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:39244) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nFWEu-0001TH-De; Thu, 03 Feb 2022 02:09:08 -0500 Original-Received: from [2607:f8b0:4864:20::1036] (port=45047 helo=mail-pj1-x1036.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nFWEr-0006YF-Hl; Thu, 03 Feb 2022 02:09:07 -0500 Original-Received: by mail-pj1-x1036.google.com with SMTP id y5-20020a17090aca8500b001b8127e3d3aso2018250pjt.3; Wed, 02 Feb 2022 23:08:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to; bh=p98L3GQD1vFQTT48eGOp5vCVjQv8hyHNb8XDxDLI4BI=; b=G4D0KZennc5zo6OcDIplTv2A7JKJq6WeIdZZK2XDlnHDefzjmbUz7x1091VGfXkMHp n6gFBPynw1E7fRHBIwlOSMh+wp0zJgVEeJeW0Hyc2TGQ9ZdSSa861swc2W11iqKnvrOQ jvMV6OcBbx61L1WO52KKGVvZHg51kKjqi6o51i8XcHewuuYLzXipAVHXAVhsBQ1jn2Vr bupXWkgg64WyC6e2QHzu7A3VyTaLZm1Wg/yoRW8OD4Ot5aefSZHWGIlI4LyZPqQwSach ZuSzgj/j7O+Fhxpd4jTVoGcVW5F4yg0SIoNxyv0+S7U/+Je/987uekX/BD7L6AhuUdxv aCTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=p98L3GQD1vFQTT48eGOp5vCVjQv8hyHNb8XDxDLI4BI=; b=5paAfRbG0n8THH4bQz3WguUAQehmIaHKWPuW9VDdFyLH3XbhBaVS2cARhwDsQWY8yj 5gL2JkSOcKsyEhYGq/t141czdutoVcLyrD13uI3Uy2YtZ69HoyR4wVNAsxGqjCEk3FF0 cVSdxTHTY2sDXJ+givj+tfc3s/s22iL9t+Ha1ylE/n52xsPYMQkz1vFzYKnpWPmk6Ly5 E6nO6380Bl6X8dSehsgM/LtNBf3kAtV20QIU/+LeOn7YCvWv3ehBYUG3WmeEJAfcJ+IQ h/MU9v0FeyolEEkpg0NEyipiNQX398kcPhtFkRFMjOMxGk8LVQ0UdtoJbqcqgzO0f3Y7 Xu9g== X-Gm-Message-State: AOAM530CdjIrrNeJxfHjiN/QASIyjAmbNUwII4UkExuURQIwqBz7Ej1o YPF9OIXioJWnQbaPSoEJkJLHwRxRuDJRmbl4EkNk//5Ph7k= X-Google-Smtp-Source: ABdhPJxoGzDtFE86d6/CC0w/hO5Lj3gmLz1Q5+uAFLhpBD/axEhxeKY7k6G4a8iOn3Hc+S7utbOkWMNBvRx/y4SKEug= X-Received: by 2002:a17:903:1212:: with SMTP id l18mr33751645plh.77.1643872137600; Wed, 02 Feb 2022 23:08:57 -0800 (PST) X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::1036 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::1036; envelope-from=stefan.itampe@gmail.com; helo=mail-pj1-x1036.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Original-Sender: "guile-devel" Xref: news.gmane.io gmane.lisp.guile.devel:21062 gmane.lisp.guile.user:17989 Archived-At: --000000000000d161a605d717ceea Content-Type: text/plain; charset="UTF-8" Hi all, I have streamlined my c-based superfast vector copy lib in stis-supervectors to get a self contained c-file that generates *vector-copy! that handles all types of bytevectors and SCM vectors, can have different directions can have different endianes and can have arbitrary intervals like pythons [1:2:3]. Only the reasonable safe variants are possible e.g. not signed to unsigned and not u64 to u32. But we do doubles -> float (although it can be dangerous). Takes about 10s with O2 to compile. We may wonder why we need a C based version of this. Well for one thing it can benchmark guiles' own routines. And all these copy routines can be made quite fast on contemporary computers (memcpy speed). If people are interested in including it in guile, I'll be happy to sign over the copyright to FSF, else it is a nice lib to play with. If there is interest I can make a small project to host it outside the stis-supervector lib where a scm interface at a higher level can be made. Link: https://gitlab.com/tampe/stis-supervectors/-/blob/main/src/vector-copy.c Regards Stefan --000000000000d161a605d717ceea Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi all,

I have streamlined my c-based s= uperfast=C2=A0vector copy lib in stis-supervectors to get a self contained = c-file that generates *vector-copy! that handles all types of bytevectors a= nd SCM vectors, can have different directions can have different endianes a= nd can have arbitrary=C2=A0intervals like pythons [1:2:3]. Only the reasona= ble safe variants are possible e.g. not signed to unsigned and not u64 to u= 32. But we do doubles -> float (although it can be dangerous). Takes abo= ut 10s with O2 to compile.


We may w= onder why we need a C based version of this. Well for one thing it can benc= hmark guiles' own routines. And all these copy routines can be made qui= te fast on contemporary computers (memcpy speed).

=
If people are interested=C2=A0in including it in guile, I'll be ha= ppy=C2=A0to sign over the copyright to FSF, else it is a nice lib to play w= ith. If there is interest I can make a small project to host it outside the= stis-supervector lib where a scm interface=C2=A0at a higher level can be m= ade.

Link:
Regards
Stefan

<= /div> --000000000000d161a605d717ceea--