Content sniffing benchmarking script (Was: Re: Suggestion for file type detection approach)



Em Sáb, 2004-01-03 às 12:28, Jeffrey Stedfast escreveu:
> has anyone actually done any profiling? or even testing the sniffer
> itself to see how fast it could detect all this? I seriously doubt it is
> as slow as people are making it out to be.
> 
> Jeff

The attached script does some dumb benchmarking. I don't know if it is
accurate enough to be taken seriously.

The process of using it is as follows:

1. Reboot into single mode (to flush read cache/buffers)
2. Run this script. It will create /root/vfsperformance-gnomevfs.txt
3. Reboot again into single mode (to flush read cache/buffers)
4. Run the script again. It will create /root/vfsperformance-ls.txt

This script does a 'time gnome-vfs-ls' and a 'time ls' on a bunch of
directories and prints the results inside these .txt files.
Additionally, it creates /root/vfsperformance-totals.txt to give us a
chance to compare the speed of the entire process in both programs.

<Quoting the bash(1) help:>

time: time [-p] PIPELINE
    Execute PIPELINE and print a summary of the real time, 
user CPU time, and system CPU time spent executing PIPELINE 
when it terminates.

</Quote>

The results of my machine[1] follow:

[root hermes root]# cat vfsperformance-totals.txt 

Sat Jan  3 14:20:49 BRT 2004
Testing with gnomevfs-ls

real    1m2.616s
user    0m5.578s
sys     0m3.347s

Sat Jan  3 14:24:15 BRT 2004
Testing with ls

real    0m0.944s
user    0m0.156s
sys     0m0.106s

------------------------
These results were achieved using an untouched version of gnomevfs.

After modifying gnomevfs (libfile.so) to prevent content sniffing, the
results were:

Sat Jan  3 14:32:30 BRT 2004
Testing with gnomevfs-ls

real    0m4.769s
user    0m2.001s
sys     0m0.574s

------------------------

Could someone run this script and share the results with us?

[1] The machine is an AMD Duron 950 MHz with 256MB of RAM and a SAMSUNG
SV4002H, ATA DISK drive and running Debian Unstable

Best regards,

-- 
Fabio Gomes de Souza <fabio gs2 com br> (+55 81 9127-0597)

.- GS2 TECNOLOGIA DA INFORMACAO LTDA :: www.gs2.com.br
|- IT Infrastructure :: Security :: Embedded systems :: Linux
`- Olinda, Brazil - +55 81 3492-7777 - negocios gs2 com br

#!/bin/sh

# Stupid benchmarking process:

# 1. Boot your machine in single-user mode
# 2. Run this script. It will create /root/performance-gnomevfs.txt
# 3. Reboot again, to flush read cache (buffers)
# 4. Run this script again. It will create /root/performance-ls.txt

if [ -f /root/vfsperformance-gnomevfs.txt ]; then
	COMMAND=ls
	FILE=/root/vfsperformance-ls.txt
else
	COMMAND=gnomevfs-ls
	FILE=/root/vfsperformance-gnomevfs.txt
fi

export COMMAND FILE

TOTALS=/root/vfsperformance-totals.txt
echo >> $TOTALS
date >> $TOTALS

echo > $FILE
{
	time { 
		echo Testing with $COMMAND >> $TOTALS
		# Add your custom directories below
		for dir in \
				/usr/bin \
				/usr/lib \
				/var/lib/dpkg/info \
				/usr/share/info \
				/usr/share/man/man? \
				; do 
	
			echo Testing $COMMAND $dir >> $FILE 
			bash -c "time $COMMAND $dir > /dev/null" 2>> $FILE 
		done
	};
} 2>> $TOTALS



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]