123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121 |
- #!/bin/bash
- #
- # Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies).
- # All rights reserved.
- # This component and the accompanying materials are made available
- # under the terms of the License "Eclipse Public License v1.0"
- # which accompanies this distribution, and is available
- # at the URL "http://www.eclipse.org/legal/epl-v10.html".
- #
- # Initial Contributors:
- # Nokia Corporation - initial contribution.
- #
- # Contributors:
- #
- # Description:
- # Performance testing script for Fuse filesystems
- # see how well "stat" works
- #
- . ./test_common.sh
- if [ $? -ne 0 ]; then
- echo "can't locate test environment config"; exit 1;
- fi
- count=10000
- range=`eval "echo {1..$count}"`
- export MOUNTPOINT range count
- cleanup && init
- echo "TEST: stat performance - testing if a file exists. $count repetitions"
- echo -e "\ncaseless-fuse: different nonexisting files"
- time (
- for i in $range; do
- test -f $MOUNTPOINT/.notexist_$i
- done
- )
- echo -e "\nnative-fs: different nonexisting files"
- time (
- for i in $range; do
- test -f $MOUNTSOURCE/.notexist_$i
- done
- )
- echo -e "\ncaseless-fuse: same existing file"
- time (
- for i in $range; do
- test -f $MOUNTPOINT/a
- done
- )
- echo -e "\nnativefs: same existing file"
- time (
- for i in $range; do
- test -f $MOUNTSOURCE/a
- done
- )
- echo -e "\ncaseless-fuse: same NON existing file"
- time (
- for i in $range; do
- test -f $MOUNTPOINT/a.notexist
- done
- )
- echo -e "\nnativefs: Same NON existing file"
- time (
- for i in $range; do
- test -f $MOUNTSOURCE/a.notexist
- done
- )
- echo -e "------------------------\n"
- echo -e "TEST: Serial Write Performance\n"
- rm $MOUNTPOINT/write_test 2>/dev/null
- echo -e "caseless-fuse: write 2MB file - short blocks"
- time (
- dd if=/dev/zero of=$MOUNTPOINT/write_test bs=$(( 2 * 1024)) count=1024
- )
- rm $MOUNTSOURCE/write_test 2>/dev/null
- echo -e "native-fs: write 2MB file - short blocks"
- time (
- dd if=/dev/zero of=$MOUNTSOURCE/write_test bs=$(( 2 * 1024 )) count=1024
- )
- rm $MOUNTPOINT/write_test_2 2>/dev/null
- echo -e "caseless-fuse: write 2MB file - large blocks"
- time (
- dd if=/dev/zero of=$MOUNTPOINT/write_test_2 bs=$(( 4 * 1024)) count=256
- )
- rm $MOUNTSOURCE/write_test_2 2>/dev/null
- echo -e "native-fs: write 2MB file - large blocks"
- time (
- dd if=/dev/zero of=$MOUNTSOURCE/write_test_2 bs=$(( 4 * 1024 )) count=256
- )
- echo -e "------------------------\n"
- echo -e "TEST: Serial Read Performance\n"
- sleep 2 # allow cache to empty
- echo -e "caseless-fuse: read 2MB file"
- time (
- dd of=/dev/null if=$MOUNTPOINT/write_test bs=$(( 2 * 1024)) count=1024
- )
- echo -e "native-fs: read 2MB file"
- time (
- dd of=/dev/null if=$MOUNTSOURCE/write_test bs=$(( 2 * 1024 )) count=1024
- )
|