473,583 Members | 3,089 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Java vs Perl for specific tasks

Hello,

I have a rather odd question. My company is an all java/oracle shop.
We do everything is Java... no matter what it is... parsing of text
files, messaging, gui you name it. My question is this... is Perl so
much better at parsing text files and outputing that we would see a
substantial speed increase? We process about 10 million records in
flat files a day for reformatting before putting them in a DB.

Also, when it comes to Unix threading... which one would be better off
Java or perl? Essentially, we would break the 10 million down into 10
files... each file is done in a seperate thread... The program also
has to keep a hashmap of keys to make sure we don;t include duplicate
records and it must connect to oracle every once in a while... is
switching to perl worth it considering the investment and know how we
have in java? This is the only portion of the code we would consider
switching to perl...

ideas?

Thanks,

Joie
Jul 17 '05 #1
6 5938
John Smith wrote:
I have a rather odd question. My company is an all java/oracle shop.
We do everything is Java... no matter what it is... parsing of text
files, messaging, gui you name it. My question is this... is Perl so
much better at parsing text files and outputing that we would see a
substantial speed increase? We process about 10 million records in
flat files a day for reformatting before putting them in a DB.
Parsing text with regular expressions is build in to Perl. Also working
with regular expressions is part of the language. Ten years ago that was
quite unique.

With Java 1.4, regular expressions is also build in to Java or else you
could use regexp from Apache.

So the only difference left is syntaxis. With Java you have to type more
code.

Perl also has some very nice regex features, like non-greedy matching,
but now all other regex libraries took over the Perl features.

So, taken all together, there is not much advancement of Perl above Java.
Also, when it comes to Unix threading... which one would be better off
Java or perl? Essentially, we would break the 10 million down into 10
files... each file is done in a seperate thread... The program also
has to keep a hashmap of keys to make sure we don;t include duplicate
records and it must connect to oracle every once in a while... is
switching to perl worth it considering the investment and know how we
have in java? This is the only portion of the code we would consider
switching to perl...


Java has nice thread support. Don't know about Perl.

Edwin Martin

--
http://www.bitstorm.org/edwin/en/
Jul 17 '05 #2
li************* @yahoo.com (John Smith) wrote in message news:<24******* *************** ****@posting.go ogle.com>...
Hello,

I have a rather odd question.
Odd indeed.
My company is an all java/oracle shop.
We do everything is Java... no matter what it is... parsing of text
files, messaging, gui you name it. My question is this... is Perl so
much better at parsing text files and outputing that we would see a
substantial speed increase? We process about 10 million records in
flat files a day for reformatting before putting them in a DB.
That might be something you could write some test cases for. regex
engines are complex enough that it can be difficult to predict speed
without trying things out on real data. And you are the one with the
real data you would be using it on.

There are some differences in worst case handling in current versions,
I don't remember what they are. You might go over to perl.org and hunt
for a mail list to get opinions of people with real experience with
perl. (I'm just a wannabee, myself.) They could also point you in the
right directions to get good sample code to work with.
Also, when it comes to Unix threading... which one would be better off
Java or perl?
Which UNIX? Which libraries?

Which Java? come to think of it ...
Essentially, we would break the 10 million down into 10
files... each file is done in a seperate thread... The program also
has to keep a hashmap of keys to make sure we don;t include duplicate
records and it must connect to oracle every once in a while... is
switching to perl worth it considering the investment and know how we
have in java? This is the only portion of the code we would consider
switching to perl...


Not knowing why you are asking these questions makes it difficult to
come up with reasons you might want to investigate perl. But I think
it could be worth your while to investigate, just because I personally
find perl easier to write in (whether clean code or sloppy), and also
because CPAN has a huge depository of useful stuff not yet matched by
the Java community. RegExes are not the half of what perl is.

Switching, of course, is the wrong question to ask. Think in terms of
filling out your toolbox a bit.

JDZ
Jul 17 '05 #3
jo************* ******@yahoo.co m (Joseph Daniel Zukiger) wrote in message news:<d1******* *************** ****@posting.go ogle.com>...
li************* @yahoo.com (John Smith) wrote in message news:<24******* *************** ****@posting.go ogle.com>...
Hello,

I have a rather odd question.
Odd indeed.
My company is an all java/oracle shop.
We do everything is Java... no matter what it is... parsing of text
files, messaging, gui you name it. My question is this... is Perl so
much better at parsing text files and outputing that we would see a
substantial speed increase? We process about 10 million records in
flat files a day for reformatting before putting them in a DB.


That might be something you could write some test cases for. regex
engines are complex enough that it can be difficult to predict speed
without trying things out on real data. And you are the one with the
real data you would be using it on.

There are some differences in worst case handling in current versions,
I don't remember what they are. You might go over to perl.org and hunt
for a mail list to get opinions of people with real experience with
perl. (I'm just a wannabee, myself.) They could also point you in the
right directions to get good sample code to work with.
Also, when it comes to Unix threading... which one would be better off
Java or perl?


Which UNIX? Which libraries?

Which Java? come to think of it ...


We would be delpoying the solution on a linux box, a suse, redhat,
etc...

And it would be using Java 1.4.2 (1.5 once it gets to a 1.5.1) or perl
5.8...

Essentially, we would break the 10 million down into 10
files... each file is done in a seperate thread... The program also
has to keep a hashmap of keys to make sure we don;t include duplicate
records and it must connect to oracle every once in a while... is
switching to perl worth it considering the investment and know how we
have in java? This is the only portion of the code we would consider
switching to perl...


Not knowing why you are asking these questions makes it difficult to
come up with reasons you might want to investigate perl. But I think
it could be worth your while to investigate, just because I personally
find perl easier to write in (whether clean code or sloppy), and also
because CPAN has a huge depository of useful stuff not yet matched by
the Java community. RegExes are not the half of what perl is.

Switching, of course, is the wrong question to ask. Think in terms of
filling out your toolbox a bit.


Honestly, I am the type of person who hates to get away from something
I know, but for some reason this task seemed like a good reason to
check out something else... co-workers suggested we write it in C, but
perl is just easier on the eyes and I basically said we go perl or
stay java. the other issue is Java in general runs best on solaris...
but when we were given a linux box to do this stuff we started asking
if we should stick with java for this specific ask.
ideas?
JDZ

Jul 17 '05 #4
I haven't a lot of experience writing multiple threaded applications
in Perl. If multiple thread are important I haven't a clue about
how well it would stack up compared to Java. Probably not as well.

But Perl might be a way to go. Perl has a more flexible object model
than Java does. Once you get used to it it's easy to like

I've reviewed Java 1.4's regular expression capabilities. It is
a clean implementation but it doesn't approach what you can do in Perl.

The Jakarata ORO package gives you all the regular expression
stuff you get with Perl. It is also less verbose than Java 1.4.

If you develop something in Perl, then later decide to translate
it line for line into Java ORO can do that.

li************* @yahoo.com (John Smith) wrote in message news:<24******* *************** ****@posting.go ogle.com>...
Hello,

I have a rather odd question. My company is an all java/oracle shop.
We do everything is Java... no matter what it is... parsing of text
files, messaging, gui you name it. My question is this... is Perl so
much better at parsing text files and outputing that we would see a
substantial speed increase? We process about 10 million records in
flat files a day for reformatting before putting them in a DB.

Also, when it comes to Unix threading... which one would be better off
Java or perl? Essentially, we would break the 10 million down into 10
files... each file is done in a seperate thread... The program also
has to keep a hashmap of keys to make sure we don;t include duplicate
records and it must connect to oracle every once in a while... is
switching to perl worth it considering the investment and know how we
have in java? This is the only portion of the code we would consider
switching to perl...

ideas?

Thanks,

Joie

Jul 17 '05 #5
li************* @yahoo.com (John Smith) wrote in message news:<24******* *************** ****@posting.go ogle.com>...
jo************* ******@yahoo.co m (Joseph Daniel Zukiger) wrote in message news:<d1******* *************** ****@posting.go ogle.com>...
li************* @yahoo.com (John Smith) wrote in message news:<24******* *************** ****@posting.go ogle.com>...
Hello,

I have a rather odd question.
Odd indeed.
My company is an all java/oracle shop.
We do everything is Java... no matter what it is... parsing of text
files, messaging, gui you name it. My question is this... is Perl so
much better at parsing text files and outputing that we would see a
substantial speed increase? We process about 10 million records in
flat files a day for reformatting before putting them in a DB.


That might be something you could write some test cases for. regex
engines are complex enough that it can be difficult to predict speed
without trying things out on real data. And you are the one with the
real data you would be using it on.

There are some differences in worst case handling in current versions,
I don't remember what they are. You might go over to perl.org and hunt
for a mail list to get opinions of people with real experience with
perl. (I'm just a wannabee, myself.) They could also point you in the
right directions to get good sample code to work with.
Also, when it comes to Unix threading... which one would be better off
Java or perl?


Which UNIX? Which libraries?

Which Java? come to think of it ...


We would be delpoying the solution on a linux box, a suse, redhat,
etc...

And it would be using Java 1.4.2 (1.5 once it gets to a 1.5.1) or perl
5.8...


Well, perl 6 looks to be not nearly as close as Java 5. Not sure what
that means, although perl 6 is supposed to clean perl up a bit and
java 5 is supposed to cover some of the inflexibility that has made it
verbose.
Essentially, we would break the 10 million down into 10
files... each file is done in a seperate thread... The program also
has to keep a hashmap of keys to make sure we don;t include duplicate
records and it must connect to oracle every once in a while... is
switching to perl worth it considering the investment and know how we
have in java? This is the only portion of the code we would consider
switching to perl...


Not knowing why you are asking these questions makes it difficult to
come up with reasons you might want to investigate perl. But I think
it could be worth your while to investigate, just because I personally
find perl easier to write in (whether clean code or sloppy), and also
because CPAN has a huge depository of useful stuff not yet matched by
the Java community. RegExes are not the half of what perl is.

Switching, of course, is the wrong question to ask. Think in terms of
filling out your toolbox a bit.


Honestly, I am the type of person who hates to get away from something
I know, but for some reason this task seemed like a good reason to
check out something else... co-workers suggested we write it in C, but
perl is just easier on the eyes and I basically said we go perl or
stay java.


Interesting thought.
the other issue is Java in general runs best on solaris...
but when we were given a linux box to do this stuff we started asking
if we should stick with java for this specific ask.
If you're using RedHat supported stuff, I hear you'll need to compile
perl yourselves to get the full advantage of 5.8. No big deal, I do it
myself from time to time. If you are used to handling version upgrades
in Java, you'll have some idea of what to expect.
ideas?


Well, look around CPAN and the MLs you can find at perl.org, and see
what you find that looks related to the task. Other than that, still
too abstract for me to say much.
Jul 17 '05 #6
My rule of thumb is that if the code is short (~ 100 lines), I
do it in Perl. Else, I do it in Java. Java is better with regard
to code readability.

Binh

li************* @yahoo.com (John Smith) wrote in message news:<24******* *************** ****@posting.go ogle.com>...
Hello,

I have a rather odd question. My company is an all java/oracle shop.
We do everything is Java... no matter what it is... parsing of text
files, messaging, gui you name it. My question is this... is Perl so
much better at parsing text files and outputing that we would see a
substantial speed increase? We process about 10 million records in
flat files a day for reformatting before putting them in a DB.

Also, when it comes to Unix threading... which one would be better off
Java or perl? Essentially, we would break the 10 million down into 10
files... each file is done in a seperate thread... The program also
has to keep a hashmap of keys to make sure we don;t include duplicate
records and it must connect to oracle every once in a while... is
switching to perl worth it considering the investment and know how we
have in java? This is the only portion of the code we would consider
switching to perl...

ideas?

Thanks,

Joie

Jul 17 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

42
4063
by: Fred Ma | last post by:
Hello, This is not a troll posting, and I've refrained from asking because I've seen similar threads get all nitter-nattery. But I really want to make a decision on how best to invest my time. I'm not interested on which language is better in *general*, just for my purpose. My area of research is in CAD algorithms, and I'm sensing the...
17
3089
by: Michael McGarry | last post by:
Hi, I am just starting to use Python. Does Python have all the regular expression features of Perl? Is Python missing any features available in Perl? Thanks, Michael
3
5500
by: Mohammd M. Hussain | last post by:
Hi, I have a good knowledge of Perl ( 2 and half years ) and despite working with the language that long, I have yet to build a substantial program ( during this time I was merely testing out various aspects of the language ). I have tried many times to build a program like a web blog or a bulletin board but it seems that my attempts fail...
3
8153
by: John Smith | last post by:
Hello, I have a rather odd question. My company is an all java/oracle shop. We do everything is Java... no matter what it is... parsing of text files, messaging, gui you name it. My question is this... is Perl so much better at parsing text files and outputing that we would see a substantial speed increase? We process about 10 million...
4
4010
by: Thomas Honold | last post by:
Hi there, I want to generate C++ or Java code by script, e.g. classes with getter/setter methods. Someone told me that nowadays it is done with XML and XSLT. I should use - XML File which contains classnames and private members - XSLT to transform them to code files - XSLT processor which does the conversion
133
8490
by: Gaurav | last post by:
http://www.sys-con.com/story/print.cfm?storyid=45250 Any comments? Thanks Gaurav
1
9613
by: David Van D | last post by:
Hi there, A few weeks until I begin my journey towards a degree in Computer Science at Canterbury University in New Zealand, Anyway the course tutors are going to be teaching us JAVA wth bluej and I was wondering if anyone here would be able to give me some tips for young players such as myself, for learning the language. Is this the...
29
1974
by: walterbyrd | last post by:
Some think it will. Up untill now, Java has never been standard across different versions of Linux and Unix. Some think that is one reason that some developers have avoided Java in favor of Python. Now that Java has been GPL'd that might change. IMO: it won't make much difference. But I don't really know.
223
7187
by: Pilcrow | last post by:
Given that UNIX, including networking, is almost entirely coded in C, how come so many things are almost impossible in ordinary C? Examples: Network and internet access, access to UNIX interprocess controls and communication, locale determination, EBCDIC/ASCII discrimination, etc. Almost all of these are easy in Perl. Why isn't there a...
0
7895
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...
0
7826
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...
0
8182
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. ...
0
8327
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
6579
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5374
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...
0
3818
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...
1
1433
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1157
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...

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.