473,805 Members | 2,266 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Reducing memeory overheads using perl

1 New Member
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 1463
Banfa
9,065 Recognized Expert Moderator Expert
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
1931
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. The implementation is really simple, but the key is to understand what the function should be. I'll post Perl and Python codes tomorrow for those interested. If you are a perl programer, try to code it in Python. (it's easy.)
15
2601
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 ****************************************************************************** Hi fellow Python coders, I often find myself writing:: class grouping:
5
4419
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). I've seen mentioned here and there a technique that uses 'void *' and something called 'template specialization' that would reduce the amount of code generated for the
6
2541
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 to do something similiar with Perl? (and not VBA)??? The reason I ask is because I want to use Access instead of MySQL because with Access, I can design Forms and Queries to display data relatively quickly. With MySQL, I'd have to use third...
17
3713
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 bios to see all of the 4 GBytes. I some article I read that the WinXP Pro can only handle 4GBytes of memory including the virtual memory, so I set it to not use any page file, but it did not help. (2) I want my .NET application to use more then...
1
3439
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 (as I will explain below) it takes about 1.35 secs to get me back what I am looking for. Since I am doing multiple types of these searches, the total time goes in minutes, therefore, I am trying to see if I can get any help in reducing this time...
21
34450
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 obvious of which is the sharing of files. For example, you upload images to a server to share them with other people over the Internet. Perl comes ready equipped for uploading files via the CGI.pm module, which has long been a core module and allows users...
4
14455
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 sure how the algorithm of reducing fractions works. Here is part of my code: //Header File
1
4351
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: Found only 0 objects in /root/.cpan/Metadata CPAN: LWP::UserAgent loaded ok
0
9718
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9596
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10614
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10109
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7649
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6876
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5544
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5678
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3008
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.