Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

21 May, 2024: Computers section is temporarily disabled for maintenance. It will take several days before it's back.


devel / comp.lang.tcl / speed improve wanted

SubjectAuthor
* speed improve wantedclt.to.davebr
`- Re: speed improve wantedrola...@gmail.com

1
speed improve wanted

<5791682228890@dlp>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=21876&group=comp.lang.tcl#21876

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: clt.to.davebr@dfgh.net
Newsgroups: comp.lang.tcl
Subject: speed improve wanted
Date: Sun, 23 Apr 23 05:48:10 GMT
Organization: A noiseless patient Spider
Lines: 30
Message-ID: <5791682228890@dlp>
Injection-Info: dont-email.me; posting-host="c69f015f873f491b8e09542bf2ef47ca";
logging-data="3887000"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/tQqAjVdvNiai27GwGOvg2"
Cancel-Lock: sha1:z84Cx/r34YjNhcnEk6slNmhJuLs=
 by: clt.to.davebr@dfgh.net - Sun, 23 Apr 2023 05:48 UTC

I've timed the execution from entry to the proc to just before writing the result to the screen.

On my machine for the original code as a proc:
proc ex time 184 ms
inner loop time 58 ms
overhead time 126 ms

For my optimized case (list of lists, foreach ans early out)
proc ex time 87 ms
inner loop time 8 ms
overhead time 79 ms

The overhead is creating the data to be analyzed, and the outer loops.
In the optimized case about 90% of the run time is overhead, formatting the data.
This likely applies to python as well

I suspect this is the case in your actual application too.
If you want more speed, you need to minimize the work done to process
the raw data into what you analyze.
The test code should be modified to use that raw data
(or at least minimize the processing of the raw data before analysis).

Tcl has very good string processing commands, and can handle byte strings as well.
Perhaps using those data formats directly in the analysis code would increase overall speed.

Trying to speed up the inner loop at this point is likely wasted effort.

Dave B

Re: speed improve wanted

<d2764098-1665-4274-b6ed-f79527dbe8f5n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=21878&group=comp.lang.tcl#21878

  copy link   Newsgroups: comp.lang.tcl
X-Received: by 2002:a05:620a:6230:b0:74e:d34f:a4b7 with SMTP id ou48-20020a05620a623000b0074ed34fa4b7mr342141qkn.0.1682243229816;
Sun, 23 Apr 2023 02:47:09 -0700 (PDT)
X-Received: by 2002:ac8:598a:0:b0:3ef:1c64:a9ff with SMTP id
e10-20020ac8598a000000b003ef1c64a9ffmr3598694qte.10.1682243229610; Sun, 23
Apr 2023 02:47:09 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.tcl
Date: Sun, 23 Apr 2023 02:47:09 -0700 (PDT)
In-Reply-To: <5791682228890@dlp>
Injection-Info: google-groups.googlegroups.com; posting-host=116.12.56.93; posting-account=59xCUwoAAABx9tq6XUTZW-wQ1A7Z8t9L
NNTP-Posting-Host: 116.12.56.93
References: <5791682228890@dlp>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <d2764098-1665-4274-b6ed-f79527dbe8f5n@googlegroups.com>
Subject: Re: speed improve wanted
From: rolance1@gmail.com (rola...@gmail.com)
Injection-Date: Sun, 23 Apr 2023 09:47:09 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: rola...@gmail.com - Sun, 23 Apr 2023 09:47 UTC

clt.to...@dfgh.net 在 2023年4月23日 星期日下午5:48:13 [UTC+12] 的信中寫道:
> I've timed the execution from entry to the proc to just before writing the result to the screen.
>
> On my machine for the original code as a proc:
> proc ex time 184 ms
> inner loop time 58 ms
> overhead time 126 ms
>
> For my optimized case (list of lists, foreach ans early out)
> proc ex time 87 ms
> inner loop time 8 ms
> overhead time 79 ms
>
> The overhead is creating the data to be analyzed, and the outer loops.
> In the optimized case about 90% of the run time is overhead, formatting the data.
> This likely applies to python as well
>
> I suspect this is the case in your actual application too.
> If you want more speed, you need to minimize the work done to process
> the raw data into what you analyze.
> The test code should be modified to use that raw data
> (or at least minimize the processing of the raw data before analysis).
>
> Tcl has very good string processing commands, and can handle byte strings as well.
> Perhaps using those data formats directly in the analysis code would increase overall speed.
>
> Trying to speed up the inner loop at this point is likely wasted effort.
>
> Dave B

Hi Dave
thanks for your advice, will optimize my code by your suggestion

BR
Rolance


devel / comp.lang.tcl / speed improve wanted

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor