473,750 Members | 2,648 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Perl performance?

I'm a perl newbie, with next to no programming experience (I did a bunch
of Fortran 25 years ago, but nothing since).

I have a problem I need to solve, and I'm wondering whether perl is the
best tool. I need to log a fairly fast data stream to a file, after
adding a time stamp to the end of each line. The data is ASCII text, and
will be coming into a serial port on a laptop. The data stream is at
115,200 baud, with 64 lines per second, each line being 40 to 45
characters long. I'm not sure yet what format the line ends are.

I've successfully logged the data using a Windows terminal program, but I
really need to add a time stamp to each line, so I can sync the data up
with another data stream when I do the post processing. I think I could
use the Win32::SerialPo rt module to get the data into perl, have it parse
the data looking for line ends, add a time stamp to the end of each line
and log the line to a file.

Win32::SerialPo rt info:

http://members.aol.com/Bbirthisel/SerialPort.html

I realize that the time stamps will only have a resolution of one second,
but I figure that when I do the post processing I could look for the
records where the time stamp changed seconds, and then count records to
infer the time for each one. I don't need super high accuracy. Plus or
minus a half second will be more than good enough.

The only laptop I currently have available that has a serial port is a
Dell PIII 500 running Win 98. I can't put Linux on it, as it belongs to
my wife, and she needs Win 98 for some business applications. Is it
likely that a perl program would have enough performance to deal with data
at 115,200 baud, with 64 records per second?

I'm tempted to try perl as it seems to be general purpose enough that I
could use my new perl skills for all kinds of other things. But, if perl
likely won't be up to the task I'll look into using a compiled language.

Thanks for your advice,

--
Kevin Horton
Ottawa, Canada
e-mail: khorton02(_at_) rogers(_dot_)co m
Mac OS X 10.2.6, Dual G4 1.42
Jul 19 '05 #1
2 4026
Kevin Horton wrote:
I'm a perl newbie, with next to no programming experience (I did a bunch
of Fortran 25 years ago, but nothing since).

I have a problem I need to solve, and I'm wondering whether perl is the
best tool. I need to log a fairly fast data stream to a file, after
adding a time stamp to the end of each line. The data is ASCII text, and
will be coming into a serial port on a laptop. The data stream is at
115,200 baud, with 64 lines per second, each line being 40 to 45
characters long. I'm not sure yet what format the line ends are.

I've successfully logged the data using a Windows terminal program, but I
really need to add a time stamp to each line, so I can sync the data up
with another data stream when I do the post processing. I think I could
use the Win32::SerialPo rt module to get the data into perl, have it parse
the data looking for line ends, add a time stamp to the end of each line
and log the line to a file.

Win32::SerialPo rt info:

http://members.aol.com/Bbirthisel/SerialPort.html

I realize that the time stamps will only have a resolution of one second,
but I figure that when I do the post processing I could look for the
records where the time stamp changed seconds, and then count records to
infer the time for each one. I don't need super high accuracy. Plus or
minus a half second will be more than good enough.

The only laptop I currently have available that has a serial port is a
Dell PIII 500 running Win 98. I can't put Linux on it, as it belongs to
my wife, and she needs Win 98 for some business applications. Is it
likely that a perl program would have enough performance to deal with data
at 115,200 baud, with 64 records per second?

I'm tempted to try perl as it seems to be general purpose enough that I
could use my new perl skills for all kinds of other things. But, if perl
likely won't be up to the task I'll look into using a compiled language.

Thanks for your advice,


If it's a serial port, the stream cannot be that fast by modern standards.
Any language will do fine, perl is probably easier to start with than, say,
C. You can have timestamps of any precision with Time::HiRes module (look
at CPAN), or you may call gettimeofday() via syscall (I am not sure if
Windows has this function but most probably it does).

Jul 19 '05 #2
On Sun, 21 Sep 2003 04:51:41 -0400, Isaac Mushinsky wrote:
Kevin Horton wrote:
I'm a perl newbie, with next to no programming experience (I did a bunch
of Fortran 25 years ago, but nothing since).

I have a problem I need to solve, and I'm wondering whether perl is the
best tool. I need to log a fairly fast data stream to a file, after
adding a time stamp to the end of each line. The data is ASCII text,
and will be coming into a serial port on a laptop. The data stream is
at 115,200 baud, with 64 lines per second, each line being 40 to 45
characters long. I'm not sure yet what format the line ends are.

I've successfully logged the data using a Windows terminal program, but
I really need to add a time stamp to each line, so I can sync the data
up with another data stream when I do the post processing. I think I
could use the Win32::SerialPo rt module to get the data into perl, have
it parse the data looking for line ends, add a time stamp to the end of
each line and log the line to a file.

Win32::SerialPo rt info:

http://members.aol.com/Bbirthisel/SerialPort.html

I realize that the time stamps will only have a resolution of one
second, but I figure that when I do the post processing I could look for
the records where the time stamp changed seconds, and then count records
to infer the time for each one. I don't need super high accuracy. Plus
or minus a half second will be more than good enough.

The only laptop I currently have available that has a serial port is a
Dell PIII 500 running Win 98. I can't put Linux on it, as it belongs to
my wife, and she needs Win 98 for some business applications. Is it
likely that a perl program would have enough performance to deal with
data at 115,200 baud, with 64 records per second?

I'm tempted to try perl as it seems to be general purpose enough that I
could use my new perl skills for all kinds of other things. But, if
perl likely won't be up to the task I'll look into using a compiled
language.

Thanks for your advice,

If it's a serial port, the stream cannot be that fast by modern standards.
Any language will do fine, perl is probably easier to start with than,
say, C. You can have timestamps of any precision with Time::HiRes module
(look at CPAN), or you may call gettimeofday() via syscall (I am not sure
if Windows has this function but most probably it does).


Yeah, 115,200 is way faster than needed, but that is what this box puts
out, so I am stuck with it unless the vendor will heed my requests that he
ratchet the speed down a bit. I have successfully captured coherent data
using HyperTerminal PE on this laptop, so I know the serial port is up to
the task.

Thanks for the pointer to the Time::HiRes module. I'll install perl on
the laptop and start playing around with it. I suspect I'll be back for
more help once I get into this.

--
Kevin Horton
Ottawa, Canada
e-mail: khorton02(_at_) rogers(_dot_)co m
http://go.phpwebhosting.com/~khorton/rv8/

Jul 19 '05 #3

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

Similar topics

10
1900
by: Bob | last post by:
why is perl referred to as a CGI script and not php, php has the facility to execute backticked execute commands that enable the programmer to use operating system facilities as well ? why would you bother with perl when you can use PHP which is far easier than that other bloody language.
58
4509
by: @ | last post by:
A benchmark in 2002 showed PHP is much slower in shell or when Apache has Mod_Perl. With the new PHP kissing Java's ass, Perl is once again the #1 CGI choice. Java is for a big team in short time to develope something slow. ASP is a joke. PHP is a kid.
1
2258
by: Marc H. | last post by:
Hello, I recently converted one of my perl scripts to python. What the script does is simply search a lot of big mail files (~40MB) to retrieve specific emails. I simply converted the script line by line to python, keeping the algorithms & functions as they were in perl (no optimization). The purpose was mainly to learn python and see the differences with perl. Now, once the converted script was finished, I was amazed to find that
1
17721
by: Al Belden | last post by:
Hi all, I've been working on a problem that I thought might be of interest: I'm trying to replace some korn shell scripts that search source code files with perl scripts to gain certain features such as: More powerful regular expressions available in perl Ability to print out lines before and after matches (gnu grep supports this but is not availble on our Digital Unix and AIX platforms) Make searches case insensitive by default (yes, I...
7
2152
by: Ajar | last post by:
I want to write a program which will automatically login to my ISPs website, retrieve data and do some processing. Can this be done? Can you point me to any example python programs which do similar things? Regards, Ajar
9
4520
by: Dieter Vanderelst | last post by:
Dear all, I'm currently comparing Python versus Perl to use in a project that involved a lot of text processing. I'm trying to determine what the most efficient language would be for our purposes. I have to admit that, although I'm very familiar with Python, I'm complete Perl noob (and I hope to stay one) which is reflected in my questions. I know that the web offers a lot of resources on Python/Perl differences. But I couldn't find a...
0
9744
by: Kirt Loki Dankmyer | last post by:
So, I download the latest "stable" tar for perl (5.8.7) and try to compile it on the Solaris 8 (SPARC) box that I administrate. I try all sorts of different switches, but I can't get it to compile. I need it to be compiled with threads. Anyone have any wisdom on how best to do this? Here's a transcript of my latest attempt. It's long; you might want to skip to the bottom, where I try "make" and the fatal errors start happening.
6
1947
by: www.gerardvignes.com | last post by:
Hi, Have you run into a situation where you had to switch from PHP 4.x.x to Perl 5.x.x in order to get better performance? I am using an OO approach to PHP for my website's server code. There is one tiny script, with dozens of small objects. Each object is in a separate source file. It is a bit slow, even when the code doesn't do much DiskIO or MySQL.
6
3011
by: surfivor | last post by:
I may be involved in a data migration project involving databases and creating XML feeds. Our site is PHP based, so I imagine the team might suggest PHP, but I had a look at the PHP documentation for one of the Pear modules for creating XML and it didn't look like much. I've used Perl XML:Twig and I have the impression that there is more Perl stuff available as well as the Perl stuff being well documented as I have a Perl DBI book, a Perl...
0
9001
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
8838
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
9583
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
9396
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9342
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9256
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...
0
6081
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();...
1
3323
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2226
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.