Re: Sequence slicing

new topic     » goto parent     » topic index » view thread      » older message » newer message

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

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu