Re: Sequence slicing
- Posted by Robert Craig <rds at RapidEuphoria.com> Oct 21, 2003
- 512 views
Daniel Kluss wrote: > I've made a program, and Ive noticed the slowest part of it being the > slicing. Did you use: with profile_time ? > Could you tell me if there is a better(faster) way to slice. All > the values are unsigned chars so I could go the way of peeking and poking, > but dont really want to. > ex. > a=very big sequence of unsigned chars > > a=a[1..length(a)-1500]--I'm called very very very often 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. I think you need to give us some more context to this problem. What are you trying to do? Why do you have to do it so often? What is the typical length of a? Regards, Rob Craig Rapid Deployment Software http://www.RapidEuphoria.com