CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
Is there something faster than push(@array,'string')?

 



bulrush
User

Aug 30, 2016, 6:56 AM

Post #1 of 2 (2072 views)
Is there something faster than push(@array,'string')? Can't Post

I'm trying to make certain parts of my program run faster. Is there something faster than this?

Code
push(@array,'string');


  1. I just need to put the 'string' anywhere into the array, the order does not matter and the array does not get sorted.
  2. Assume the data has to go into an array, not another data structure.


Also, is there a website with hints on how to make Perl faster?

Thank you.
-----


(This post was edited by bulrush on Aug 30, 2016, 7:17 AM)


FishMonger
Veteran / Moderator

Aug 30, 2016, 9:18 AM

Post #2 of 2 (2069 views)
Re: [bulrush] Is there something faster than push(@array,'string')? [In reply to] Can't Post

Trying to do optimization on random bits of code without know if that code needs more optimization is always the wrong thing to do and a waste of time.

Profile your code before you optimize so that you can learn which parts of your code need additional optimization.

Devel::NYTProf - Powerful fast feature-rich Perl source code profiler
http://search.cpan.org/~timb/Devel-NYTProf-6.03/lib/Devel/NYTProf.pm


(This post was edited by FishMonger on Aug 30, 2016, 9:19 AM)

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives