unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Liliana Marie Prikler <liliana.prikler@ist.tugraz.at>
To: guix-devel@gnu.org
Subject: Processing large amounts of files
Date: Wed, 13 Mar 2024 12:22:32 +0100	[thread overview]
Message-ID: <2010bdb88116d64da3650b06e58979518b2c7277.camel@ist.tugraz.at> (raw)

[-- Attachment #1: Type: text/plain, Size: 918 bytes --]

Hi Guix,

I have a somewhat unusual workflow that requires me to do a number of
processes on numerous, but small input files.  The original is a bit
unwieldy and takes several minutes to compile, but I've managed to
produce a more understandable and better performing example.  Note,
that after a certain number of inputs, I get the following error:

info: .16 Loading workflow file `meow.gwl'...
info: 2.80 Computing workflow `cat'...
run: 12.96 Executing: /bin/sh -c /gnu/store/kmssbjcdcabg9fh4nxscwwpnlb4px30h-gwl-meow.scm …
error: 13.01 Wrong type argument in position 1: #f

For comparison:
  time cat /tmp/meow/{0..7769}
  […]
  
  real	0m0,144s
  user	0m0,049s
  sys	0m0,094s

It takes GWL 6 times longer to compute the workflow than to create the
inputs in Guile, and 600 times longer than to actually execute the
shell command.  I think there is room for improvement :)

Cheers

[-- Attachment #2: meow.gwl --]
[-- Type: text/plain, Size: 431 bytes --]

use-modules
  guix build utils

define %directory "/tmp/meow"
mkdir-p %directory
define %files
  map
    lambda : i
      let
        : f : file %directory / : number->string i
        call-with-output-file f
          lambda : port
            display "meow\n" port
        . f
    iota 7769

process meow
  name "meow"
  inputs %files
  outputs "meow.cat"
  # {
    cat {{inputs}} > {{outputs}}
  }

workflow cat
  processes meow

                 reply	other threads:[~2024-03-13 11:24 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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://guix.gnu.org/

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

  git send-email \
    --in-reply-to=2010bdb88116d64da3650b06e58979518b2c7277.camel@ist.tugraz.at \
    --to=liliana.prikler@ist.tugraz.at \
    --cc=guix-devel@gnu.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 public inbox

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

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).