all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: EuAndreh via Guix-patches via <guix-patches@gnu.org>
To: 58603@debbugs.gnu.org
Cc: EuAndreh <eu@euandre.org>
Subject: [bug#58603] [PATCH 3/8] gnu: Add perl-readonly-xs.
Date: Mon, 17 Oct 2022 22:38:13 -0300	[thread overview]
Message-ID: <20221018013818.12165-3-eu@euandre.org> (raw)
In-Reply-To: <20221018013818.12165-1-eu@euandre.org>

* gnu/packages/perl.scm (perl-readonly-xs): New variable.
---
 gnu/packages/perl.scm | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm
index 1146fecb6b..f5a8fad4d5 100644
--- a/gnu/packages/perl.scm
+++ b/gnu/packages/perl.scm
@@ -8854,6 +8854,38 @@ (define-public perl-readonly
 variables that should not be changed.")
     (license (package-license perl))))
 
+(define-public perl-readonly-xs
+  (package
+    (name "perl-readonly-xs")
+    (version "1.05")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append
+                    "mirror://cpan/authors/id/R/RO/ROODE/Readonly-XS-" version
+                    ".tar.gz"))
+              (sha256
+               (base32
+                "03gz7yp194fwah2bc36ww04hgw1qx8p6y68vvnywircrablc9rca"))))
+    (build-system perl-build-system)
+    (propagated-inputs (list perl-readonly))
+    (home-page "https://metacpan.org/release/Readonly-XS")
+    (synopsis "Companion module for @code{Readonly.pm}, to speed up read-only
+scalar variables")
+    (description
+     "The @code{Readonly} module is an effective way to create non-modifiable
+variables.  However, it's relatively slow.
+
+The reason it's slow is that is implements the read-only-ness of variables via
+tied objects.  This mechanism is inherently slow.  Perl simply has to do a lot
+of work under the hood to make tied variables work.
+
+This module corrects the speed problem, at least with respect to scalar
+variables.  When @code{Readonly::XS} is installed, @code{Readonly} uses it to
+access the internals of scalar variables.  Instead of creating a scalar variable
+object and tying it, @code{Readonly} simply flips the @code{SvREADONLY} bit in
+the scalar's @code{FLAGS} structure.")
+    (license license:perl-license)))
+
 (define-public perl-ref-util-xs
   (package
     (name "perl-ref-util-xs")
-- 
2.38.0





  parent reply	other threads:[~2022-10-18  1:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-18  1:32 [bug#58603] [PATCH 0/8] Add perlcritic EuAndreh via Guix-patches via
2022-10-18  1:38 ` [bug#58603] [PATCH 1/8] gnu: Add perl-config-tiny EuAndreh via Guix-patches via
2022-10-18  1:38   ` [bug#58603] [PATCH 2/8] gnu: Add perl-pod-spell EuAndreh via Guix-patches via
2022-10-18  1:38   ` EuAndreh via Guix-patches via [this message]
2022-10-18  1:38   ` [bug#58603] [PATCH 4/8] gnu: Add perl-string-format EuAndreh via Guix-patches via
2022-10-18  1:38   ` [bug#58603] [PATCH 5/8] gnu: Add perl-ppix-regexp EuAndreh via Guix-patches via
2022-10-18  1:38   ` [bug#58603] [PATCH 6/8] gnu: Add perl-ppix-quotelike EuAndreh via Guix-patches via
2022-10-18  1:38   ` [bug#58603] [PATCH 7/8] gnu: Add perl-ppix-utilities EuAndreh via Guix-patches via
2022-10-18  1:38   ` [bug#58603] [PATCH 8/8] gnu: Add perl-critic EuAndreh via Guix-patches via
2022-10-18 10:24 ` bug#58603: [PATCH 0/8] Add perlcritic Christopher Baines

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221018013818.12165-3-eu@euandre.org \
    --to=guix-patches@gnu.org \
    --cc=58603@debbugs.gnu.org \
    --cc=eu@euandre.org \
    /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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.