test_perf_stat.sh 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. #!/bin/bash
  2. #
  3. # Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies).
  4. # All rights reserved.
  5. # This component and the accompanying materials are made available
  6. # under the terms of the License "Eclipse Public License v1.0"
  7. # which accompanies this distribution, and is available
  8. # at the URL "http://www.eclipse.org/legal/epl-v10.html".
  9. #
  10. # Initial Contributors:
  11. # Nokia Corporation - initial contribution.
  12. #
  13. # Contributors:
  14. #
  15. # Description:
  16. # Performance testing script for Fuse filesystems
  17. # see how well "stat" works
  18. #
  19. . ./test_common.sh
  20. if [ $? -ne 0 ]; then
  21. echo "can't locate test environment config"; exit 1;
  22. fi
  23. count=10000
  24. range=`eval "echo {1..$count}"`
  25. export MOUNTPOINT range count
  26. cleanup && init
  27. echo "TEST: stat performance - testing if a file exists. $count repetitions"
  28. echo -e "\ncaseless-fuse: different nonexisting files"
  29. time (
  30. for i in $range; do
  31. test -f $MOUNTPOINT/.notexist_$i
  32. done
  33. )
  34. echo -e "\nnative-fs: different nonexisting files"
  35. time (
  36. for i in $range; do
  37. test -f $MOUNTSOURCE/.notexist_$i
  38. done
  39. )
  40. echo -e "\ncaseless-fuse: same existing file"
  41. time (
  42. for i in $range; do
  43. test -f $MOUNTPOINT/a
  44. done
  45. )
  46. echo -e "\nnativefs: same existing file"
  47. time (
  48. for i in $range; do
  49. test -f $MOUNTSOURCE/a
  50. done
  51. )
  52. echo -e "\ncaseless-fuse: same NON existing file"
  53. time (
  54. for i in $range; do
  55. test -f $MOUNTPOINT/a.notexist
  56. done
  57. )
  58. echo -e "\nnativefs: Same NON existing file"
  59. time (
  60. for i in $range; do
  61. test -f $MOUNTSOURCE/a.notexist
  62. done
  63. )
  64. echo -e "------------------------\n"
  65. echo -e "TEST: Serial Write Performance\n"
  66. rm $MOUNTPOINT/write_test 2>/dev/null
  67. echo -e "caseless-fuse: write 2MB file - short blocks"
  68. time (
  69. dd if=/dev/zero of=$MOUNTPOINT/write_test bs=$(( 2 * 1024)) count=1024
  70. )
  71. rm $MOUNTSOURCE/write_test 2>/dev/null
  72. echo -e "native-fs: write 2MB file - short blocks"
  73. time (
  74. dd if=/dev/zero of=$MOUNTSOURCE/write_test bs=$(( 2 * 1024 )) count=1024
  75. )
  76. rm $MOUNTPOINT/write_test_2 2>/dev/null
  77. echo -e "caseless-fuse: write 2MB file - large blocks"
  78. time (
  79. dd if=/dev/zero of=$MOUNTPOINT/write_test_2 bs=$(( 4 * 1024)) count=256
  80. )
  81. rm $MOUNTSOURCE/write_test_2 2>/dev/null
  82. echo -e "native-fs: write 2MB file - large blocks"
  83. time (
  84. dd if=/dev/zero of=$MOUNTSOURCE/write_test_2 bs=$(( 4 * 1024 )) count=256
  85. )
  86. echo -e "------------------------\n"
  87. echo -e "TEST: Serial Read Performance\n"
  88. sleep 2 # allow cache to empty
  89. echo -e "caseless-fuse: read 2MB file"
  90. time (
  91. dd of=/dev/null if=$MOUNTPOINT/write_test bs=$(( 2 * 1024)) count=1024
  92. )
  93. echo -e "native-fs: read 2MB file"
  94. time (
  95. dd of=/dev/null if=$MOUNTSOURCE/write_test bs=$(( 2 * 1024 )) count=1024
  96. )