~ubuntu-branches/ubuntu/precise/judy/precise

« back to all changes in this revision

Viewing changes to test/manual/Checkit

  • Committer: Bazaar Package Importer
  • Author(s): Theodore Y. Ts'o
  • Date: 2004-01-17 00:04:53 UTC
  • Revision ID: james.westby@ubuntu.com-20040117000453-d5sj6uoon2v1g4gf
Tags: upstream-0.0.4
ImportĀ upstreamĀ versionĀ 0.0.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
# @(#) $Revision: 4.5 $ $Source: /judy/test/manual/Checkit $
 
3
echo
 
4
echo "=== +++++++++ This test runs in 15 seconds on a PIII 750Mhz +++++++"
 
5
 
 
6
LIBJUDY=`find ../../ -name libJudy.a`
 
7
JUDY_H=`find ../../ -name Judy.h`
 
8
 
 
9
cc -O SLcompare.c         -DHASHMETHOD     -o SL_Hash
 
10
cc -O SLcompare.c         -DSPLAYMETHOD    -o SL_Splay
 
11
cc -O SLcompare.c         -DREDBLACKMETHOD -o SL_Redblack
 
12
echo
 
13
echo Compiling with Judy library: $LIBJUDY
 
14
echo
 
15
cc -O -I../../src SLcompare.c -DJUDYMETHOD -o SL_Judy     $LIBJUDY -lm
 
16
if [ $? -ne 0 ] ; then
 
17
echo "===  Failed: cc SLcompare.c -DJUDYMETHOD"
 
18
exit $?
 
19
fi
 
20
cc -O -I../../src Judy1LCheck.c            -o Judy1LCheck $LIBJUDY -lm
 
21
if [ $? -ne 0 ] ; then
 
22
echo "===  Failed: cc Judy1LCheck.c"
 
23
exit $?
 
24
fi
 
25
cc -O -I../../src Judy1LTime.c -DNOINLINE  -o Judy1LTime  $LIBJUDY -lm
 
26
if [ $? -ne 0 ] ; then
 
27
echo "===  Failed: cc Judy1LTime.c"
 
28
exit $?
 
29
fi
 
30
 
 
31
 
 
32
#  -OR-    if Judy is installed, these can be compiled from anywhere:
 
33
 
 
34
 
 
35
#cc -O SLcompare.c -DJUDYMETHOD     -o SL_Judy     -lJudy -lm 
 
36
#cc -O Judy1LCheck.c                -o Judy1LCheck -lJudy -lm
 
37
#cc -O Judy1LTime.c -DNOINLINE      -o Judy1LTime  -lJudy -lm
 
38
 
 
39
echo "===  Pass: Compile of tests"
 
40
echo
 
41
echo "     Validate Judy1/JudyL functions (except Judy*ByCount)"
 
42
./Judy1LCheck -n 300000 -B20 > /dev/null
 
43
if [ $? -ne 0 ] ; then
 
44
echo "===  Failed: Judy1/JudyL validate program"
 
45
exit $?
 
46
fi
 
47
echo "===  Pass: Judy1/JudyL validate program"
 
48
echo
 
49
echo "     Do a few timings tests of Judy1/JudyL"
 
50
echo
 
51
 
 
52
# Pop1    is: current number of Indexes stored in Judy array
 
53
# Measmts is: lookups to make measurement
 
54
# J1      is: Judy1
 
55
# JL      is: JudyL
 
56
# /I      is: per Index
 
57
# MU      is: Memory Used (allocated thru malloc(3))
 
58
# HEAP    is: Memory change measured with sbrk(0)
 
59
 
 
60
echo "      Pop1   Measmts    J1S    JLI    J1T    JLG J1MU/I JLMU/I HEAP/I"
 
61
./Judy1LTime  -n 2000000 -P1 -B19 | grep -v "^#"
 
62
echo "===  Pass: Judy1/JudyL performance program"
 
63
echo
 
64
echo "     Do a few timings tests of JudySL and friends"
 
65
echo
 
66
 
 
67
# lines         is: number of lines in source file
 
68
# avg_linelen   is: average bytes per line
 
69
# getline       is: average time go get a line and remove white space
 
70
# StoreD        is: number of unique lines stored into JudySL array
 
71
# RAMused/line  is: Memory change measured with sbrk(0)
 
72
# store/ln      is: average insert time (including duplicates)
 
73
# lookup/ln     is: average lookup time in same order as inserts
 
74
# ADT           is: Abstract Data Type method
 
75
 
 
76
echo "   lines avg_linelen  getline   StoreD RAMused/line  store/ln lookup/ln ADT"
 
77
./SL_Hash     ../../Makefile | grep HASH
 
78
./SL_Splay    ../../Makefile | grep SPLAY
 
79
./SL_Redblack ../../Makefile | grep REDBLACK
 
80
./SL_Judy     ../../Makefile | grep JUDY
 
81
if [ $? -ne 0 ] ; then
 
82
echo "===  Failed: JudySL if StoreD numbers are all the same" 
 
83
exit $?
 
84
fi
 
85
echo "===  Pass: JudySL if StoreD numbers are all the same"
 
86
echo