Sangwal’s Weblog

Just another WordPress.com weblog

Perl is slow? How to make Perl execute code fast?

leave a comment »

Here I am not going to give any lecture on how to make Perl execute your code faster. What I want to share with you is that Perl is not slow at processing text. As a novice to Perl, while writing a routine to process long text files, it happened that it executed code so fast (OK, so slow) that to process 500,000 (five hundred thousand) words I had to wait some 4 hours and 40 minutes. I was desperate that I had almost concluded that this is not a tool that can be of much use. I tried some search on the internet and found that the code to I had written to add elements to a hash was not similar to what I had coded by hit and trial. As a last resort I  persuaded myself to change the code to look like the one on the Internet. Lo and behold, the same script now processed those 500,000 words in a few (10 or even less) seconds!

I used this script to find out the number of words that I had used over a period time and found that some 5,800 words I used. In my dad’s book, “Additives and Crystallization Processs: From Fundamental to Applications,” nearly (unique) 6,890 words were used. If you’d like to know how many words you used in a particular work, provide me with the text and I can give you the report for free. :) Alternatively, you can buy my Perl script also.

Written by sangwal

January 30, 2008 at 5:05 pm

Pol-Ang, Polish-English (Polsko-Angielski) Dictionary

leave a comment »

Pol-Ang, Polish to English dictionary with around 25,000 words is online at http://slownik.freehostia.com. It has search facility that can find patterns in the headwords and hence can help solve crossword puzzles. More information about pattern matching is available at the dictionary website http://slownik.freehostia.com. Although the results are not comprehensive but it is still worth using. So far access to it is absolutely free. I enjoy using it and hope you’ll also like it! Best wishes.

Written by sangwal

January 27, 2008 at 10:44 pm

Indian Republic Day

leave a comment »

India today celebrated its 59th Republic day. Hearty wishes to all and sundry on this occasion. :)

Written by sangwal

January 26, 2008 at 8:17 pm

Hello, World!

leave a comment »

Hello, Everybody!

My old blog was at 360.yahoo.com/sangwal77. I overheard that Yahoo 360 is getting closed or something like, so I decided to be at a new place where I can stay may be for my whole life. You may check that while something new appears here. Good luck!

Written by sangwal

January 19, 2008 at 5:29 pm

Posted in Uncategorized

Tagged with ,

Hello world!

with one comment

Welcome to WordPress.com. This is your first post. Edit or delete it and start blogging!

Written by sangwal

November 18, 2007 at 10:28 pm

Posted in Uncategorized

Tagged with