Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Performance analysis sed vs awk Post 302667265 by Scrutinizer on Friday 6th of July 2012 03:24:01 AM
Old 07-06-2012
When using shell "time" the backticks are not required as "time" is part of the shell syntax. Also, it is good to direct the output to /dev/null, while testing and the system cache needs to be taken into account, so that either all reads are from an already cached situation (so for example, perform all tests twice and take the latter resuls), or that you create provisions, so that there is no caching or caching is reset for every test.


--
The thread with different awks and greps can be found here. The speed difference between the various awk implementations can vary wildly..
This User Gave Thanks to Scrutinizer For This Post:
 

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

AWK script: decrypt text uses frequency analysis

Ez all! I have a question how to decrypt text uses letter frequency analysis. I have code which count the letters, but what i need to do after that. Can anybody help me to write a code. VERY NEEDED! My code now: #!/usr/bin/awk -f BEGIN { FS="" } { for (i=1; i <= NF; i++) { if ($i... (4 Replies)
Discussion started by: SerJel
4 Replies

2. UNIX for Advanced & Expert Users

sed performance

hello experts, i am trying to replace a line in a 100+mb text file. the structure is similar to the passwd file, id:value1:value2 and so on. using the sed command sed -i 's/\(123\):\(\{1,\}\):/\1:bar:/' data.txt works nicely, the line "123:foo:" is replaced by "123:bar:". however, it takes... (7 Replies)
Discussion started by: f3k
7 Replies

3. UNIX for Advanced & Expert Users

WEB Server Log File Analysis using awk/sed/grep

I'm trying to find a way to show large page sizes (page size in K) from multiple web server log files. Essentially I want to show only rows from a file where a specific column is larger than some value. Has anyone ever done this type of log analysis? If so, a snippet of code would be very... (2 Replies)
Discussion started by: mike_cataldo@ad
2 Replies

4. Shell Programming and Scripting

Increase sed performance

I'm using sed to do find and replace. But since the file is huge and i have more than 1000 files to be searched, the script is taking a lot of time. Can somebody help me with a better sed command. Below is the details. Input: 1 1 2 3 3 4 5 5 Here I know the file is sorted. ... (4 Replies)
Discussion started by: gpaulose
4 Replies

5. Linux

Routing table vulnerability comparison between two versions and analysis of performance in a scenari

Hi Routing tables in a typical linux kernel are implemented using hash data structures. So if the hash table is forced to behave more like a linked list(i.e create chaining) the purpose of using hash is defeated and time complexity increases. I want to try to assess the performance deterioration... (0 Replies)
Discussion started by: coolvaibhav
0 Replies

6. Shell Programming and Scripting

Date and time range extraction via Awk or analysis script?

Hello does anyone know of an awk that will extract log file entries between a specific date and time range, eg: awk '/15\/Dec\/2010:16:10:00/, /15\/Dec\/2010:16:15:00/' access_log but one that works? Or a free command line log file analysis tool/script? I'd like to be able to view... (2 Replies)
Discussion started by: competitions
2 Replies

7. Shell Programming and Scripting

Log Analysis with AWK with Time difference

I would like to write a shell script that calculated the time difference bettween the log entries. If the time difference is higher as 200 sec. print the complette lines out. My Problem is, i am unable to jump in the next line and calculate the time difference. Thank you for your Help. ... (5 Replies)
Discussion started by: fabian3010
5 Replies

8. Red Hat

What is the best tools for performance data gathering and analysis?

Dear Guru, IHAC who complaint that his CentOS is getting performance issue. I have to help him out of there. Could you please tell me which tools is better to gathering the whole system performance data? -- CPU/Memory/IO(disk & Network)/swap I would like the tools could be... (6 Replies)
Discussion started by: devyfong
6 Replies
NSCD(8) 						    BSD System Manager's Manual 						   NSCD(8)

NAME
nscd -- name service caching daemon SYNOPSIS
nscd [-dnst] [-i cachename] [-I cachename] DESCRIPTION
The nscd utility is the system caching daemon. It can cache almost all types of data and is basically intended to be used with the nsswitch subsystem. The cache is actually per-user. This means that each user can work only with the cached data that were cached by themselves, and cannot poison the cache of other users. The nscd utility supports two types of caching: Type Description Common caching Each cached element is the key+value pair. This type of caching supports policies which are applied when maximum number of cached ele- ments is exceeded. Three policies are available: FIFO (first in - first out), LRU (least recently used) and LFU (least frequently used). This type of caching is used with the getXXXbyname() family of functions. Multipart caching Each cached element is the part of the elements sequence. This type of caching is intended to be used with the getXXXent() family of functions. The nscd utility is able not only to cache elements, but to perform the actual nsswitch lookups by itself. To enable this feature, use the perform-actual-lookups parameter in nscd.conf(5). The nscd utility recognizes the following runtime options: -n Do not daemonize; nscd will not fork or disconnect itself from the terminal. -s Single-threaded mode. Forces using only one thread for all processing purposes (it overrides the threads parameter in the nscd.conf(5) file). -t Trace mode. All trace messages will be written to stdout. This mode is usually used with -n and -s flags are used for debugging purposes. -i cachename Invalidates personal cache. When specified, nscd acts as the administration tool. It asks the already running nscd to invalidate the specified part of the cache of the calling user. For example, sometimes you may want to invalidate your ``hosts'' cache. You can specify ``all'' as the cachename to invalidate your personal cache as a whole. You cannot use this option for the cachename for which the perform-actual-lookups option is enabled. -I cachename Invalidates the cache for every user. When specified, nscd acts as the administration tool. It asks the already running nscd to invalidate the specified part of the cache for every user. You can specify ``all'' as the cachename to invalidate the whole cache. Only the root can use this option. FILES
/etc/nscd.conf The default configuration file. SEE ALSO
nsdispatch(3), nscd.conf(5), nsswitch.conf(5) AUTHORS
Michael Bushkov <bushman@FreeBSD.org> BUGS
Please send bug reports and suggestions to <bushman@FreeBSD.org>. BSD
October 20, 2005 BSD
All times are GMT -4. The time now is 06:06 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy