Re: Sequence slicing
- Posted by "Daniel Kluss" <codepilot at netzero.net> Oct 22, 2003
- 508 views
Question for Rob, is the below accurate, sounds like it to me. Could this interfere with the "If a is very large, and there are no other references to the same sequence, this statement will be extremely fast. Euphoria will simply update the length of a, without copying any elements or allocating/deallocating any space." you said before. What should I do about it, would just assigning the length to a var then the slice make it faster? or not? Daniel Kluss ----- Original Message ----- From: "PeterBlonner" <peter at blonner.com> To: <EUforum at topica.com> Sent: Tuesday, October 21, 2003 9:10 PM Subject: Re: Sequence slicing > > > Is it possible that a form of recorsion happens here i.e that the length() > operation is effected by the result of this line's execution ? > I'm only making a tentative suggestion for why it could take unusually long > (since really the length() function should be done as the situation before > the line was executed) > > Peter Blonner > > > ----- Original Message ----- > From: "Daniel Kluss" <codepilot at netzero.net> > To: <EUforum at topica.com> > Sent: Wednesday, October 22, 2003 2:03 PM > Subject: Re: Sequence slicing > > > > Heres a snipet, thats all one line by the way, and it takes forever > > > > sockets[sock][SOCKET_DATA][tDEST][tDATA]=sockets[sock][SOCKET_DATA][tDEST][t > > DATA][diff+1..length(sockets[sock][SOCKET_DATA][tDEST][tDATA])] > > > > > > ----- Original Message ----- > > From: "Greg Haberek" <g.haberek at comcast.net> > > To: <EUforum at topica.com> > > Sent: Tuesday, October 21, 2003 7:57 PM > > Subject: Re: Sequence slicing > > > > > > > > while 1 do > > > > a&=data > > > > send(a[1..1500 to 5000 or more]) > > > > a=a[1..length(a)-acknowleged()] > > > > end while > > > > > > are you sure that calling acknowledged() isn't the bottle neck of your > > code? > > > try asigning it to a variable first, then profile it: > > > > > > atom ack > > > > > > while 1 do > > > a &= data > > > send( a[1..some_length] ) > > > ack = acknowledged() -- does this take forever, > > > a = a[1..length(a)-ack] -- or this? > > > end while > > > > > > > > > TOPICA - Start your own email discussion group. FREE! > > > > > > > > TOPICA - Start your own email discussion group. FREE! > > > > > > > TOPICA - Start your own email discussion group. FREE! > >