Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

6 May, 2024: The networking issue during the past two days has been identified and may be fixed. Will keep monitoring.


devel / comp.lang.python / Caching (memoization) in (Gauche / Lisp / Scheme) and Python

SubjectAuthor
o Caching (memoization) in (Gauche / Lisp / Scheme) and PythonHen Hanna

1
Caching (memoization) in (Gauche / Lisp / Scheme) and Python

<9431b335-f2dd-46ca-ab1d-f4653dd67d9dn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=19547&group=comp.lang.python#19547

  copy link   Newsgroups: comp.lang.python
X-Received: by 2002:a0c:e00f:0:b0:4ad:40f:4c8a with SMTP id j15-20020a0ce00f000000b004ad040f4c8amr11886306qvk.92.1663517942021;
Sun, 18 Sep 2022 09:19:02 -0700 (PDT)
X-Received: by 2002:a05:6870:6125:b0:126:c619:2b68 with SMTP id
s37-20020a056870612500b00126c6192b68mr7449085oae.284.1663517941808; Sun, 18
Sep 2022 09:19:01 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.python
Date: Sun, 18 Sep 2022 09:19:01 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=2601:648:8600:6f70:0:0:0:a597;
posting-account=YjTkGAoAAAA4_fbAISfvtIqrYbghMeBx
NNTP-Posting-Host: 2601:648:8600:6f70:0:0:0:a597
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <9431b335-f2dd-46ca-ab1d-f4653dd67d9dn@googlegroups.com>
Subject: Caching (memoization) in (Gauche / Lisp / Scheme) and Python
From: henha...@gmail.com (Hen Hanna)
Injection-Date: Sun, 18 Sep 2022 16:19:02 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 1986
 by: Hen Hanna - Sun, 18 Sep 2022 16:19 UTC

so... for a few days i've been revising this Code (in Gauche / Lisp / Scheme) to make it run faster.. and last night i could improve it enough to give me the result i wanted in 72 minutes or so (on my slow PC at home).

( Maybe... within a few months, i'll write the same program in Python .... to see if it runs 10 or 20 times faster. )

this was the first time i've used Caching (memoization). ----- instead of calculating (at run-time) Factorial(x) and Combination(x,y) millions of times, i made 2 tables in advance... A simple Table-lookup (Vector-ref in Scheme) seems 100 -- 1000 times faster.

One thought i had was... Maybe Python's Factorial(x) and Combination(x,y) (in Numpy ?) are already so fast that... i don't have to do the Caching (memoization) ???

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor