Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

You have a tendency to feel you are superior to most computers.


devel / comp.lang.tcl / Runtime impact when using "pure tcl tclreadline"

SubjectAuthor
* Runtime impact when using "pure tcl tclreadline"Sebastien Marchal
`* Runtime impact when using "pure tcl tclreadline"Sebastien Marchal
 `* Runtime impact when using "pure tcl tclreadline"Sebastien Marchal
  `- Runtime impact when using "pure tcl tclreadline"heinrichmartin

1
Runtime impact when using "pure tcl tclreadline"

<1064224a-2a8f-468c-a3b3-3b8c58408adan@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.tcl
X-Received: by 2002:a37:b782:0:b0:727:1bb8:1d40 with SMTP id h124-20020a37b782000000b007271bb81d40mr140556qkf.351.1675777873853;
Tue, 07 Feb 2023 05:51:13 -0800 (PST)
X-Received: by 2002:a25:9f90:0:b0:885:80c5:f677 with SMTP id
u16-20020a259f90000000b0088580c5f677mr468353ybq.225.1675777873377; Tue, 07
Feb 2023 05:51:13 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.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.tcl
Date: Tue, 7 Feb 2023 05:51:13 -0800 (PST)
Injection-Info: google-groups.googlegroups.com; posting-host=165.225.20.91; posting-account=-fpLiwoAAAC1cZZVu5vLY4CU_9O-FRjH
NNTP-Posting-Host: 165.225.20.91
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <1064224a-2a8f-468c-a3b3-3b8c58408adan@googlegroups.com>
Subject: Runtime impact when using "pure tcl tclreadline"
From: marchals...@gmail.com (Sebastien Marchal)
Injection-Date: Tue, 07 Feb 2023 13:51:13 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2404
 by: Sebastien Marchal - Tue, 7 Feb 2023 13:51 UTC

After some research, for a project I have used "https://wiki.tcl-lang.org/page/Pure-tcl+readline2" to make an interactive tcl shell. The absence of compilation was the driving force for me.
I am running this through "expect", not TclX. It is working well, but I am observing a huge performance hit when running anything in it VS pure tcl.

Specifically, in interactive mode if I do:
source a_noticeably_long_operation.tcl
VS
tclsh a_noticeably_long_operation.tcl

I get a 10x perf degradation in the interactive session, through "source". This took me a bit by surprise since I am using 'source' - so I should be 'out' of the interactive wrapper.

Digging a bit into the code of the pure tcl readline, I am not clear what is causing the issue, and if any 'trick' could make it work better. I observe that a lot happens to stdin and stdout, but I don't see how that can relates to the perf of say 'source'.

I walked around the tcl wiki on this subject of 'pure tcl' readlines alternative, but could not find anything usefull on performance.

Does anyone understanding a bit how this pure tcl wrapper works "in details" could point me where they might be slow ? If not known, I will have to profile that and this looks like a daunting task ...

Thanks in for any pointers,

Best regards,

Sebastien.

Re: Runtime impact when using "pure tcl tclreadline"

<c101c8ea-e2b4-47d7-990a-9ed1f7c98c7an@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.tcl
X-Received: by 2002:a0c:9d44:0:b0:56c:1461:186 with SMTP id n4-20020a0c9d44000000b0056c14610186mr855631qvf.16.1675950603167;
Thu, 09 Feb 2023 05:50:03 -0800 (PST)
X-Received: by 2002:a5b:24c:0:b0:7ca:9b40:72a7 with SMTP id
g12-20020a5b024c000000b007ca9b4072a7mr1277659ybp.130.1675950602740; Thu, 09
Feb 2023 05:50:02 -0800 (PST)
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.tcl
Date: Thu, 9 Feb 2023 05:50:02 -0800 (PST)
In-Reply-To: <1064224a-2a8f-468c-a3b3-3b8c58408adan@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=165.225.20.91; posting-account=-fpLiwoAAAC1cZZVu5vLY4CU_9O-FRjH
NNTP-Posting-Host: 165.225.20.91
References: <1064224a-2a8f-468c-a3b3-3b8c58408adan@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <c101c8ea-e2b4-47d7-990a-9ed1f7c98c7an@googlegroups.com>
Subject: Re: Runtime impact when using "pure tcl tclreadline"
From: marchals...@gmail.com (Sebastien Marchal)
Injection-Date: Thu, 09 Feb 2023 13:50:03 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 3268
 by: Sebastien Marchal - Thu, 9 Feb 2023 13:50 UTC

Le mardi 7 février 2023 à 14:51:16 UTC+1, Sebastien Marchal a écrit :
> After some research, for a project I have used "https://wiki.tcl-lang.org/page/Pure-tcl+readline2" to make an interactive tcl shell. The absence of compilation was the driving force for me.
> I am running this through "expect", not TclX. It is working well, but I am observing a huge performance hit when running anything in it VS pure tcl.
>
> Specifically, in interactive mode if I do:
> source a_noticeably_long_operation.tcl
> VS
> tclsh a_noticeably_long_operation.tcl
>
> I get a 10x perf degradation in the interactive session, through "source".. This took me a bit by surprise since I am using 'source' - so I should be 'out' of the interactive wrapper.
>
> Digging a bit into the code of the pure tcl readline, I am not clear what is causing the issue, and if any 'trick' could make it work better. I observe that a lot happens to stdin and stdout, but I don't see how that can relates to the perf of say 'source'.
>
> I walked around the tcl wiki on this subject of 'pure tcl' readlines alternative, but could not find anything usefull on performance.
>
> Does anyone understanding a bit how this pure tcl wrapper works "in details" could point me where they might be slow ? If not known, I will have to profile that and this looks like a daunting task ...
>
> Thanks in for any pointers,
>
> Best regards,
>
> Sebastien.
I have inspected further the problem.

It 'thickens' on my side, and the problem is not 'that generic'. I created some dummy long operations, and pure tcl run the same. Those are other things - specific to me - that takes much longer. Those are tcl extension in C++ provided by others, and because it is C++ I assumed could not be them.
I will continue the profiling, but my request was a bit premature ... If I find the issue the culprit and it can be of general interest, I'll update the thread.

Sebastien.

Re: Runtime impact when using "pure tcl tclreadline"

<d077b046-a2b8-48d3-9a8a-27a7682dc5ffn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.tcl
X-Received: by 2002:a0c:aa4e:0:b0:537:702d:4db8 with SMTP id e14-20020a0caa4e000000b00537702d4db8mr1079452qvb.47.1675963059285;
Thu, 09 Feb 2023 09:17:39 -0800 (PST)
X-Received: by 2002:a5b:24c:0:b0:87a:68fd:181a with SMTP id
g12-20020a5b024c000000b0087a68fd181amr1474734ybp.36.1675963058774; Thu, 09
Feb 2023 09:17:38 -0800 (PST)
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.tcl
Date: Thu, 9 Feb 2023 09:17:38 -0800 (PST)
In-Reply-To: <c101c8ea-e2b4-47d7-990a-9ed1f7c98c7an@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=165.225.20.91; posting-account=-fpLiwoAAAC1cZZVu5vLY4CU_9O-FRjH
NNTP-Posting-Host: 165.225.20.91
References: <1064224a-2a8f-468c-a3b3-3b8c58408adan@googlegroups.com> <c101c8ea-e2b4-47d7-990a-9ed1f7c98c7an@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <d077b046-a2b8-48d3-9a8a-27a7682dc5ffn@googlegroups.com>
Subject: Re: Runtime impact when using "pure tcl tclreadline"
From: marchals...@gmail.com (Sebastien Marchal)
Injection-Date: Thu, 09 Feb 2023 17:17:39 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 4277
 by: Sebastien Marchal - Thu, 9 Feb 2023 17:17 UTC

Le jeudi 9 février 2023 à 14:51:26 UTC+1, Sebastien Marchal a écrit :
> Le mardi 7 février 2023 à 14:51:16 UTC+1, Sebastien Marchal a écrit :
> > After some research, for a project I have used "https://wiki.tcl-lang.org/page/Pure-tcl+readline2" to make an interactive tcl shell. The absence of compilation was the driving force for me.
> > I am running this through "expect", not TclX. It is working well, but I am observing a huge performance hit when running anything in it VS pure tcl.
> >
> > Specifically, in interactive mode if I do:
> > source a_noticeably_long_operation.tcl
> > VS
> > tclsh a_noticeably_long_operation.tcl
> >
> > I get a 10x perf degradation in the interactive session, through "source". This took me a bit by surprise since I am using 'source' - so I should be 'out' of the interactive wrapper.
> >
> > Digging a bit into the code of the pure tcl readline, I am not clear what is causing the issue, and if any 'trick' could make it work better. I observe that a lot happens to stdin and stdout, but I don't see how that can relates to the perf of say 'source'.
> >
> > I walked around the tcl wiki on this subject of 'pure tcl' readlines alternative, but could not find anything usefull on performance.
> >
> > Does anyone understanding a bit how this pure tcl wrapper works "in details" could point me where they might be slow ? If not known, I will have to profile that and this looks like a daunting task ...
> >
> > Thanks in for any pointers,
> >
> > Best regards,
> >
> > Sebastien.
> I have inspected further the problem.
>
> It 'thickens' on my side, and the problem is not 'that generic'. I created some dummy long operations, and pure tcl run the same. Those are other things - specific to me - that takes much longer. Those are tcl extension in C++ provided by others, and because it is C++ I assumed could not be them.
> I will continue the profiling, but my request was a bit premature ... If I find the issue the culprit and it can be of general interest, I'll update the thread.
>
> Sebastien.

Continuing my own monolog, and I found the issue.

Indeed, the 'pure tcl' wrapper include a cutomized 'unkown' to enable calling aliases or shell commands. And it does does that for anything - ie it first check for this before calling the standard unkown.
In my case, the C++ code extension uses an 'objected oriented' still for calling thing with a new procedure for every object created so that you can do $object call_this_method instead of call_this_method $object. Not 100% sure of what is going in here, but clearly disabling the special unkown of the pure tcl readline returns performance to the same level in interactive VS batch.

So, I need to see how to improve the tcl readline unkown or the c++ thing to avoid calling unkown over and over.

Re: Runtime impact when using "pure tcl tclreadline"

<66ea979f-ffd7-408e-b7a6-e3726e3566ccn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.tcl
X-Received: by 2002:a0c:b284:0:b0:56b:ea50:7e93 with SMTP id r4-20020a0cb284000000b0056bea507e93mr1228560qve.21.1676016729603;
Fri, 10 Feb 2023 00:12:09 -0800 (PST)
X-Received: by 2002:a25:c712:0:b0:85a:abeb:786 with SMTP id
w18-20020a25c712000000b0085aabeb0786mr1133716ybe.583.1676016729395; Fri, 10
Feb 2023 00:12:09 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.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.tcl
Date: Fri, 10 Feb 2023 00:12:08 -0800 (PST)
In-Reply-To: <d077b046-a2b8-48d3-9a8a-27a7682dc5ffn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=84.115.226.251; posting-account=Od2xOAoAAACEyRX3Iu5rYt4oevuoeYUG
NNTP-Posting-Host: 84.115.226.251
References: <1064224a-2a8f-468c-a3b3-3b8c58408adan@googlegroups.com>
<c101c8ea-e2b4-47d7-990a-9ed1f7c98c7an@googlegroups.com> <d077b046-a2b8-48d3-9a8a-27a7682dc5ffn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <66ea979f-ffd7-408e-b7a6-e3726e3566ccn@googlegroups.com>
Subject: Re: Runtime impact when using "pure tcl tclreadline"
From: martin.h...@frequentis.com (heinrichmartin)
Injection-Date: Fri, 10 Feb 2023 08:12:09 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2620
 by: heinrichmartin - Fri, 10 Feb 2023 08:12 UTC

On Thursday, February 9, 2023 at 6:17:45 PM UTC+1, Sebastien Marchal wrote:
> Le jeudi 9 février 2023 à 14:51:26 UTC+1, Sebastien Marchal a écrit :
> > Le mardi 7 février 2023 à 14:51:16 UTC+1, Sebastien Marchal a écrit :
> Continuing my own monolog, and I found the issue.

While you are the lone writer, be assured that the community can benefit! I was reading :-)

> Indeed, the 'pure tcl' wrapper include a cutomized 'unkown' to enable calling aliases or shell commands. And it does does that for anything - ie it first check for this before calling the standard unkown.
> In my case, the C++ code extension uses an 'objected oriented' still for calling thing with a new procedure for every object created so that you can do $object call_this_method instead of call_this_method $object. Not 100% sure of what is going in here, but clearly disabling the special unkown of the pure tcl readline returns performance to the same level in interactive VS batch.
>
> So, I need to see how to improve the tcl readline unkown or the c++ thing to avoid calling unkown over and over.

If that extension is using unknown and introspection for the "new procedure for every object", then aliases could be the way to go.


devel / comp.lang.tcl / Runtime impact when using "pure tcl tclreadline"

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor