kvarnerexpress
Jan 11 2006, 09:34 PM
Just figured I'd post this real quick as I found the experience fairly amusing. I was working on some code last week that, when I applied it to the full set of data, took about 1 hour and 10 minutes to run. Needless to say, this is quite slow, however I was using unoptimized code. I went for correctness first. Anyway, the first thing I noticed was that I could eliminate a good deal of array copying. I fixed that and it cut the time down to 23 minutes. This is still a lot slower than I wanted, so I went back to trying to optimize the code. After trying various things and researching some different things to optimize in Perl, I tried something completely and utterly stupid: I changed push to unshift. Now, I could do this since I was sorting the array later anyway, so ordering did not matter at this point. Did it work? The code ran in 34 seconds. I must say, I was quite shocked by this. This leads me to my question: what's the difference between push and unshift in terms of how they work? I know they put data on different sides of the array. I'm just wondering why that made such a profound performance difference.
Reply
kvkv
Feb 5 2006, 08:51 AM
That is a bit shocking because internally perl manages arrays as lists. And push() and unshift() are almost the same when it comes to performance. Are you sure you are dealing with the same set of data and haven't changed anything else? Can you post a code snippet that I can look into?
Reply
Similar Topics
Keywords : optimization, tale
- Website Optimization Help
(0)
Google Optimization For Drupal
(0) If I search my own site in google, the first page isn't my home page, but a profile of one of my
members in Drupal. My homepage is just 2 results under it. I think that's very enoying. Does
anyone know how to change that? I really love Drupal. So I don't want to change it for any other
content management system. Thanks....
Css Resolution Optimization
(6) Hey, I've got a CSS sheet that was for some reason optimized for 1171x721. How can I scale that
down to 1024x768? Or make it so it has no optimization and is just scrollable? Thanks /smile.gif"
style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /> Harrison....
Search Engine Optimization Tools
(11) Hi All, I'm looking for some tools or any tricks for the SEO.. I have studied many things
online about google search rank, page rank .. and all but all goes from above my head /sad.gif"
style="vertical-align:middle" emoid=":(" border="0" alt="sad.gif" /> can anyone tell me in simple
way how I can bring my site in at least top 20-30 in google if not in top 10 thanks dedesigns
Edit typo ....
Free Seo
search engine optimization (2) where could you find free SEO? i simple don't know any company to offer that kind of service...
there is just gxm sollutions who does offer this service... the page is http://www.graphixmix.go.ro
....
Free E-gold Games Scripts
Free e-gold games: head or tale game, batch game....Where can I get th (1) Hello. I am going to open my own e-gold games site, so I need e-gold games scripts. Does someone
know from where I can get them? THX.....
Image Optimization?
Anybody have some info or tutorials on Image Optimization? (6) Hi, Im am to present the subject: Image Optimization in class this saturday, Ive have already
started searching and Investigating all the info I can get from google and places like P2L, but If
you happen to know something about the subject, or know some really good tutorials about it please
reply. Thanks in advance. /smile.gif" style="vertical-align:middle" emoid=":)" border="0"
alt="smile.gif" />....
All You Need For Seo (search Engine Optimization)
Article and Resources list (2) QUOTE SEO is an acronym for "search engine optimization". It is the process of analyzing
your potential design and problems for search engines indexing and positioning. In other words,
making your web site and its content attractive, relevant and visible to search engines and web
searchers. There is nothing worse than having a beautiful web site with excellent written content,
though you still lose traffic or you even keep potential visitors away, while your site cannot be
found. Before you begin optimizing your pages for Search Engines, consider that the fol....
Web War
a tale of two websites (8) well, it's a "unique" ongoing web war... so i'm posting it here to solicit your thoughts.
/tongue.gif' border='0' style='vertical-align:middle' alt='tongue.gif' /> once upon a time, there
were two websites: itchysquirrel and lastofthedotcoms. the latter admired the former and considered
it a "funny" site, so it asked the former for a link exchange. yup, "add our site link on your site,
we add yours" kind of deal. /tongue.gif' border='0' style='vertical-align:middle' alt='tongue.gif'
/> it went well for a while, until it was later discovered by the latter t....
Good Way To Get Ranked In Google
SEO services, search engine optimization (30) I heard the best way search engines find you even google is u have to have alot of links on your
site. The more pages and links on your site, the bigger chance search engines will find you and the
more you'll be seen on them as well. I would give you some pages i read this off of, but it was
a while ago, so why don't you search it in Google!? I hear that search engines don't
really use keywords in meta tags anymore, but if you have alot of pages with alot of stuff, you can
win. ADVERT : SEO services, search engine optimization service by SerpGuru .....
Secrets To Getting To The Top Of Google
Search Engine Optimization Tips for Google (45) Here, you will give advice (tutorials) on how to get to the top of Google.....
Help With A Css Design
code optimization (8) hello there!, i need somebody tell me how to put a scrollbar into my divs or tables, and how to
delete the h3 cellpadding or how to bold a text with css. thanks a lot! /blink.gif'
border='0' style='vertical-align:middle' alt='blink.gif' /> ....
How To Perform Search Engine Optimization
How to increase your page rank in the search engines (8) Below are some steps which all web designers should take to improve the listing of their sites in
the major search engines. STEP 1: Related titles!!!!! It is very important
when choosing a title and URL for your site that you use something that is relevant. For example,
if you are selling alarm clocks you would want a name that is related that people may type in as a
search word. STEP 2: Keywords, Keywords, Keywords!!!!!! and I'm not
talking about Meta Tags! I'm talking about keywords in your description. You....
Adsense Optimization
(4) Google will say the best for you /biggrin.gif' border='0' style='vertical-align:middle'
alt='biggrin.gif' /> https://www.google.com/support/adsense/bin/...?page=tips.html You
don't have to put URLs in code boxes because it's not code, and others can't click on
it. /smile.gif' border='0' style='vertical-align:middle' alt='smile.gif' /> ....
Google Search Engine Optimization
Utilizing META tags (3) Not sure if anyone knows about this or not, but there's actually a really cheap, easy way to
advertise, and it kinda works with the banner exchange idea. It has to do with META tags in the
header section of your html. Here's an example from one of my sites: CODE <META
name="description" content="Christy is a Tampa Strip Club Dancer"> <META
NAME="keywords" content="Tampa, Strip Club, Strip Club, Dancer, Tampa Strip Club
Dancer"> <META NAME="TITLE" CONTENT="Tampa Dancer"> <META NAME=....
Html Advertising Optimization
(0) Not sure if anyone knows about this or not, but there's actually a really cheap, easy way to
advertise, and it kinda works with the banner exchange idea. It has to do with META tags in the
header section of your html. Here's an example from one of my sites: CODE <META
name="description" content="Christy is a Tampa Strip Club Dancer"> <META
NAME="keywords" content="Tampa, Strip Club, Strip Club, Dancer, Tampa Strip Club
Dancer"> <META NAME="TITLE" CONTENT="Tampa Dancer"> <META NAME=....
Shark Tale ?
Woopee (9) Hey hey hey anyone seen it ??? It is REALLY REALLY REALLY good......ist it ?? YES........ It's
excellent..................................................................working at the car wash
...YEAH....
Optimization Software
what software you are using? (28) hello all! i am new here and interested in website optimization i seen several websites using
doorways? anybody here using it? and what software you use to make it?....
Looking for optimization, tale
|
|
Searching Video's for optimization, tale
|
advertisement
|
|