Welcome to Linux Forums!

With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.

Linux Forum ArticlesLinux ForumsLinux Forum DownloadsLinux HostsFree MagazinesJobs
Home|Register|FAQ|Member List|Calendar|Unanswered Posts|Forum Rules|Today's Posts|Advanced Search|
SEARCH FOR IN
Go Back   Linux Forums > The Community > Comments / Feedback / Suggestions
Reload this Page Rebuild Perl open source to speed up performance?
Linux Forums
Linux Forums
Welcome To The Linux Forums!
Welcome to Linux Forums. We pride ourselves in being one of the largest Linux communities on the web, we encourage you to REGISTER on our forums and participate in the community. There are over 150,000 members ready to answer your questions. JOINING US today will allow you to make new posts, get support, send messages to other members and submit downloads to our downloads directory and many other great features!

Comments / Feedback / Suggestions Post bugs, comments, suggestions and anything else site related in here. Also see the Site News section for LinuxForums announcements

Site Navigation
Articles
Linux Forums
Linux Downloads
Linux Hosting
Free Magazines
Job Board
Linux Forum Topics
Linux Forums
Your Distro
Linux Resources
GNU Linux Zone
The Community
Reply
 
Thread Tools Display Modes
Old 11-01-2006   #1 (permalink)
Just Joined!
 
Join Date: Sep 2006
Posts: 3
Rebuild Perl open source to speed up performance?

Hi there,

I was asked by my friend (about 40% CPU bandwidth on perl??), who ran an small ERP system on Intel Xeon processor.

That caused my "enthusiasm" to research on how to reduce CPU cycles for "perl" process in the system.

I have downloaded Perl v.5.8.8 (stable.tar.gz) from http://www.perl.com/download.csp and extract it onto my Red Hat Enterprise Linux AS release 4 (Nahant Update 2)/Intel Xeon MP machine.

I used ./Configure to specify Perl's environment configuration and gcc compiler used at first time to generate perl program and libraries. I used "./perl test.pl" to run test (test.pl has been attached in this thread), also I can use Intel VTune(TM) Performance Analyzer for Linux (from http://www3.intel.com/cd/software/pr.../eng/index.htm) to generate profiling data by using "vtl activity perl_gcc -d 60 -c sampling -app "./perl, test.pl" run"

Now I can get profiling data file (.tb5) from /root/VTune/Projects/Sampling
and import this file into VTune Ananlzyer GUI. See "perl" process below -
Event "Clockticks" = 8,359,449,00
Event "Instruction Retire" = 5,340,216,000
Clockticks per Instructions Retired (CPI) = 1.565
Total duartion = 5.81s

I found that CPU consumed of most functions are flat, like as Perl_runops_standard(), Perl_pp_gvsv(), Perl_leave_scope(), Perl_sv_upgrade(), etc. That means if you optmized one of function - overall performance will speed up slowly.

I heard that Intel C++ compiler has strong capability on optimizing C++ code, so I reconfigured perl environment and select Intel icc as compiler. However if I used icc compiler options, like as "-fast", "-ipo", "-parallel", "axP" to rebuild perl - the results are not satisfied. I inspected on perl's source code, they have limited data processing, huge macro-defined functions, huge branch in deep loop. I realized that I can use "-O2 -g -prof-gen" to generate first perl, then run perl several times, all feedback (profiling) data will be written into .dyn for each perl's source file. Second time, I use icc with options "-O2 -g -prof-use" to generat new perl.

I ran perl on test.pl again and got performance as below for "perl" process -
Event "Clockticks" = 7,063,479,000 (vs. gcc's 8,359,449,00)
Event "Instruction Retire" = 5,139,120,000 (vs. gcc's 5,340,216,000)
Clockticks per Instructions Retired (CPI) = 1.374 (vs. gcc's 1.565)
Total duartion = 5.53s (vs gcc's 5.81s)

It seems that I saved 0.28s (or 5% of all time) to run perl with test.pl.

So if you want to generate optimized perl for your system, you may choose Intel C++ compiler and use "prof-gen" to generate application which can collect performance data, then use "prof-use" to feed data to compiler to generate your final application. Optimize your code on instruction cache line NOW!!!

Intel VTune Analyzer can help you to know the benifit gain in detail.


Regards, Peter
Attached Files
File Type: zip test.zip (1.0 KB, 3 views)
zwang88 is offline   Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off
Job Search
keyword location
Post a Job »
job title, keywords or company
city, state or zip jobs by job search

Free Magazines
Free eBook:"Vulnerability Management for Dummies"
Get all the Facts and See How to Implement a Successful Vulnerability Management Program.
subscribe
Google vs The World: The Battle of the Message Security Vendors
With such a powerful name behind it, Google Message Security stands out in a sea of products that do exactly the same thing - or so they say. So when it comes right down to it, how does the Google selection stack up against the rest of messaging security's big guns?
subscribe
The Enterprise Newsweekly
eWeek is the essential technology information source for builders of e-business.
subscribe
Oracle Magazine
Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe
Total Telecom
Total Telecom is "The Economist of the communications industry".
subscribe
More free magazines »



All times are GMT. The time now is 02:27 PM.




© 2000 - 2008 - All Rights Reserved - Property of  MAS Media

Content Relevant URLs by vBSEO 3.2.0