zsh-workers
 help / color / mirror / code / Atom feed
From: Sebastian Gniazdowski <psprint@zdharma.org>
To: Bart Schaefer <schaefer@brasslantern.com>, zsh-workers@zsh.org
Subject: Re: Add redis-db module to upstream?
Date: Thu, 8 Jun 2017 06:01:36 +0200	[thread overview]
Message-ID: <etPan.5938cc20.238e1f29.8e19@MacMini.local> (raw)

On 8 czerwca 2017 at 00:10:20, Bart Schaefer (schaefer@brasslantern.com) wrote:
> rather than further overloading typeset. We need a way to select
> the module (ztie -d ...) and to specify external objects (ztie -f

Current option set:

Usage: ztie -d db/... [-z] [-r] [-p password] [-P password_file] -f/-a {db_address} {parameter_name}
Options:
 -d:       select database type: "db/gdbm", "db/redis"
 -z:       zero-cache for read operations (always access database)
 -r:       create read-only parameter
 -f or -a: database-address in format {host}[:port][/[db_idx][/key]] or a file path
 -p:       database-password to be used for authentication
 -P:       path to file with database-password

Also, -l for "load password", for the password mechanism. Not so cool mnemonic ("load"), maybe a better one can be invented.

> store in a simple attibute-value database. Specifically to zsh it can
> be used to share state among shells (for example IF we could rely on it

I heard fish has the universal variables, shared among sessions. Too bad I don't know how to do typeset -F SECONDS=0 there, I would compare performance there too:

echo ${#redis_list}; typeset -F SECONDS=0; repeat 1000; do local -a copy=( $redis_list ); done; echo $SECONDS
1100
1.4957760000

local_list=( $redis_list )
typeset -F SECONDS=0; repeat 1000; do local -a copy=( $local_list ); done; echo $SECONDS
0.5719420000

So not that bad, x2.6. For array of 5 elements:

typeset -F SECONDS=0; repeat 1000; do local -a copy=( $redis_list ); done; echo $SECONDS
0.1843630000
typeset -F SECONDS=0; repeat 1000; do local -a copy=( $local_list ); done; echo $SECONDS
0.0125850000

That's 14.6 times slower, but only 0.000184s per access. So not even a 1 ms time. This was for system under load (compilation of Emacs), without load the 1100 results are the same, while for 5 elements, it's: 0.1277 vs. 0.009106, x14, 0.0001277 per access.

Cool idea about the clustering mechanism.

--
Sebastian Gniazdowski
psprint /at/ zdharma.org


             reply	other threads:[~2017-06-08  4:12 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-08  4:01 Sebastian Gniazdowski [this message]
  -- strict thread matches above, loose matches on Subject: below --
2017-06-03  3:24 Sebastian Gniazdowski
2017-06-03 17:09 ` Bart Schaefer
2017-06-03 19:35   ` Daniel Shahaf
2017-06-04  5:57     ` Sebastian Gniazdowski
2017-06-04  6:23       ` Sebastian Gniazdowski
2017-06-06  2:28     ` Eric Cook
2017-06-07  9:29     ` Oliver Kiddle
2017-06-07 11:08       ` Sebastian Gniazdowski
2017-06-07 13:04       ` Daniel Shahaf
2017-06-07 22:10       ` Bart Schaefer
2017-06-04  8:35   ` Sebastian Gniazdowski

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=etPan.5938cc20.238e1f29.8e19@MacMini.local \
    --to=psprint@zdharma.org \
    --cc=schaefer@brasslantern.com \
    --cc=zsh-workers@zsh.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.vuxu.org/mirror/zsh/

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 NNTP newsgroup(s).