473,395 Members | 1,568 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Reducing memeory overheads using perl

Hi

I am Tarun Jindal a s/w engineer working in Satyam computers

I would like to ask some question from you.

We at Satyam is developing a software which will built xml for out clients.

We had developed software in Perl but we are experiencing performance hit.

We built the xml tags according to some criteria but we did not take care of capitalization & ordering, as a result of which we were unable to load the xml into the database as the parser did not validate the xml files.

Later we included sort element function & did Capitalization into our code which made the code run very slow as a result we are looking for some other alternative.

We thought of XSLT but when we try to built 150MB or larger file we get a message of “Out of Memory”

I would appreciate if you kindly look in this matter.
Is there any soultion to increase the heap size or some fucntion through which we cal decerease the memory use.



Platform -: Linux

Language-: Perl



I would be very grateful if you kindly assist in this manner & enlighten me with your opinion.

Thanks & Regards
Tarun Jindal
Software Engineer
Satyam Computers Services Limited.
Satyam CyberSpace
Survery No: 12p, Madhapur
Hyderabad - 500081
Mobile No.: +91-9849278383


I am including the sort element code for the referece

Expand|Select|Wrap|Line Numbers
  1. This part of code takes 15 to 20 hours to sort & create 2-3 gb of file..
  2. -->> Can we put some unix or perl fucntion to reduce the memory usage & increase the productivity ..
  3. ####To reorder the xml elements according to DTD
  4. sub sortElements {
  5.   my $input = shift;
  6.   $input =~ s/\n//ig;
  7.  
  8.   my $finalXml;
  9.   my $tagVal;
  10.   for (@orderArray){
  11.  
  12.       my $curr = $_;
  13.       $tagVal = '';
  14.       if($input =~ /$curr/i){
  15.         $input =~ s/(\<$curr.*\>.*\<\/$curr\>|\<$curr\/\>)/$tagVal = $&/ige;
  16.  
  17.         if($curr =~ /(Features|Generefs|Geneextrefs|Organisms|CommentGene)/i){
  18.           $tagVal =~ s/(\<$1\s*\/\>|\<$1\s*\>\s*\<\/$1\s*\>)//ig;
  19.         }
  20.  
  21.         for (@childArray) {
  22.           my $child = $_;
  23.           if($child =~ /(LocOp|Qualifiers|Comment)/i){
  24.             $tagVal =~ s/(\<$1\s*\/\>|\<$1\s*\>\s*\<\/$1\s*\>)//ig;
  25.             $tagVal =~ s/locop/LocOp/ig;
  26.           }
  27.         }
  28.  
  29.         if($curr =~ /Feature/){
  30.           $tagVal =~ s/end_pos/endPos/ig;
  31.           $tagVal =~ s/start_pos/startPos/ig;
  32.         }
  33.         if($curr =~ /Generefs|Geneextrefs/){
  34.          $tagVal =~ s/(\<Generef\s*|\<Geneextref\s*)(\w*) href/$1 $2 xlink\:href/ig;
  35.          $tagVal =~ s/(\<Generef\s*|\<Geneextref\s*)(\w*) type/$1 $2 xlink\:type/ig;
  36.         }
  37.       }
  38.       if(length $tagVal){
  39.         $finalXml .= $tagVal;
  40.       }
  41.   }
  42.  
  43.  
  44.   return $finalXml;
  45.  
  46. }
Jan 12 '07 #1
1 1447
Banfa
9,065 Expert Mod 8TB
I have moved this thread to the Perl forum since it is a Perl question
Jan 12 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: Xah Lee | last post by:
here's a interesting real-world algoritm to have fun with. attached below is the Perl documentation that i wrote for a function called "reduce", which is really the heart of a larger software. ...
15
by: Ralf W. Grosse-Kunstleve | last post by:
****************************************************************************** This posting is also available in HTML format: http://cci.lbl.gov/~rwgk/python/adopt_init_args_2005_07_02.html...
5
by: Salvador I. Ducros | last post by:
Greetings all, I was hoping someone might be able to point me in the right direction. I'm currently using std::vector to maintain several lists whose objects are of unrelated types (classes)....
6
by: Doomster | last post by:
In a previous job, we had Perl scripts which could interact with a SQL DB using Perl's DBI module We were able to programmatically add, delete and query tables using this module. Is it possible...
17
by: Sharon | last post by:
I Have a PC with dual XEON CPU’s and 4 Giga Byte RAM win Windows XP Pro. I have 2 problems with it: (1) Windows is showing only 3.25 Giga byte on the System Properties ? General tab. While the...
1
by: B | last post by:
Hello All, This is my first time using this list, but hopefully I got the right one for the question I need to ask :). I have a table which has about 4 million records. When I do a search...
21
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Uploading files from a local computer to a remote web server has many useful purposes, the most...
4
by: d0ugg | last post by:
Hello everyone, I'm creating a program that it is suppose to add, subtract, multiply and also divide fractions and after that, the result has to be reduced to the lowest terms. However, I'm not...
1
by: spatro | last post by:
Hi, I am trying to install DBD::mysql using the CPAN and I am facing the following error: cpan> install DBD::mysql CPAN: Storable loaded ok Going to read /root/.cpan/Metadata Warning:...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.