Commit 96bc7e6
committed
Use hash func to boost file creation and lookup
Introduce a hash-based mechanism to speed up file creation and lookup
operations. The hash function enables faster access to extent and logical
block extent index, improving overall filesystem performance.
hash_code = file_hash(file_name);
extent index = hash_code / SIMPLEFS_MAX_BLOCKS_PER_EXTENT
block index = hash_code % SIMPLEFS_MAX_BLOCKS_PER_EXTENT;
Use perf to measure:
1. File Creation (random)
Legacy:
259.842753513 seconds time elapsed
23.000247000 seconds user
150.380145000 seconds sys
full_name_hash:
222.274028604 seconds time elapsed
20.794966000 seconds user
151.941876000 seconds sys
2. File Listing (random)
Legacy:
min time: 0.00171 s
max time: 0.03799 s
avg time: 0.00423332 s
tot time: 129.539510 s
full_name_hash:
min time: 0.00171 s
max time: 0.03588 s
avg time: 0.00305601 s
tot time: 93.514040 s
3. files Removal (Random)
Legacy:
106.921706288 seconds time elapsed
16.987883000 seconds user
91.268661000 seconds sys
full_name_hash:
86.132655220 seconds time elapsed
19.180209000 seconds user
68.476075000 seconds sys1 parent d190d31 commit 96bc7e6
5 files changed
+276
-181
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
| 84 | + | |
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
0 commit comments