Project

General

Profile

Search prototype » History » Version 7

Greg Burri, 06/26/2009 08:03 PM

1 1 Greg Burri
h1. Search prototype
2
3
directory : source:/prototypes/03_Search
4
5
h2. Goals
6
7 3 Greg Burri
8 1 Greg Burri
* Search with glob pattern.
9
* Measure the time for searching among 50'000 files. There is always two measures to test the caching capacity of the OS.
10 2 Greg Burri
** A solution is to generate randomly empty files and folders and create an iso with it which will be stored in the repo.
11
* If time is above 1 minute for the first time and above 3 seconds for the seconds then an another solution must be found like an indexing system.
12 3 Greg Burri
13
14 4 Greg Burri
h2. Setup
15 3 Greg Burri
16 6 Greg Burri
The file source:/prototypes/03_Search/files.iso.bzip2 contains about 50'000 files and can be mounted with the following commands.
17
<pre>
18
$> bunzip2 files.iso.bzip2
19
$> mkdir files
20
$> sudo mount -o loop files.iso files
21
</pre>
22
It will bunzip the file, create a directory _files_ and mount the iso file.
23 3 Greg Burri
24 1 Greg Burri
25 4 Greg Burri
h2. Reference times
26
27
Here is some reference times given by the _find_ command.
28
29 1 Greg Burri
<pre>
30 4 Greg Burri
<flynux:~/code/projects/aybabtu/prototypes/03_Search $> sudo mount -o loop files.iso files/
31 3 Greg Burri
[sudo] password for gburri: 
32 5 Greg Burri
33 4 Greg Burri
<flynux:~/code/projects/aybabtu/prototypes/03_Search $> time find files/ -iname "*1234*"
34 3 Greg Burri
tree2/tree/055cba22/005f1168/20fe14e1/221234aa
35
tree2/tree/055cba22/0bc10022/de8ccd6d/31234116
36
tree2/tree/055cba22/78da82a9/c634ba77/881234a0
37
tree2/tree/055cba22/b7a538f2/caaf9076/212349d5
38 1 Greg Burri
39 3 Greg Burri
real    0m1.932s
40
user    0m0.140s
41
sys     0m1.716s
42 5 Greg Burri
43 4 Greg Burri
<flynux:~/code/projects/aybabtu/prototypes/03_Search $> time find files/ -iname "*1234*"
44 3 Greg Burri
tree2/tree/055cba22/005f1168/20fe14e1/221234aa
45
tree2/tree/055cba22/0bc10022/de8ccd6d/31234116
46
tree2/tree/055cba22/78da82a9/c634ba77/881234a0
47
tree2/tree/055cba22/b7a538f2/caaf9076/212349d5
48
49
real    0m0.382s
50
user    0m0.200s
51
sys     0m0.176s
52
</pre>
53 7 Greg Burri
54
h2. Times from the prototype
55
56
Measured in release mode.
57
58
source:prototypes/03_Search@36daf15fa072500575ff3f252c55b500e0972f26
59
60
<pre>
61
<flynux:~/code/projects/aybabtu/prototypes/03_Search $> time ./03_Search search tree "*1234*"
62
/home/gburri/code/projects/aybabtu/prototypes/03_Search/tree/b301a5ef/dd21a1d1/0cc1234f
63
/home/gburri/code/projects/aybabtu/prototypes/03_Search/tree/394173f8/5b947a9a/db4fce33/51234260
64
/home/gburri/code/projects/aybabtu/prototypes/03_Search/tree/b301a5ef/8e6e6b98/d1deca60/123445ed
65
/home/gburri/code/projects/aybabtu/prototypes/03_Search/tree/b301a5ef/9e439990/34a960b1/db261234
66
67
real    0m30.329s
68
user    0m2.460s
69
sys     0m1.804s
70
71
<flynux:~/code/projects/aybabtu/prototypes/03_Search $> time ./03_Search search tree "*1234*"
72
/home/gburri/code/projects/aybabtu/prototypes/03_Search/tree/b301a5ef/dd21a1d1/0cc1234f
73
/home/gburri/code/projects/aybabtu/prototypes/03_Search/tree/394173f8/5b947a9a/db4fce33/51234260
74
/home/gburri/code/projects/aybabtu/prototypes/03_Search/tree/b301a5ef/8e6e6b98/d1deca60/123445ed
75
/home/gburri/code/projects/aybabtu/prototypes/03_Search/tree/b301a5ef/9e439990/34a960b1/db261234
76
77
real    0m1.912s
78
user    0m1.060s
79
sys     0m0.756s
80
</pre>
81
82
So .. theses times are very bad...