mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-11 05:32:59 +00:00
Reduce kmalloc() traffic in directory iteration.
Pass the file name in a stack-allocated buffer instead of using an AK::String when iterating directories. This dramatically reduces the amount of cycles spent traversing the filesystem.
This commit is contained in:
parent
5e8e554f94
commit
19b9401487
Notes:
sideshowbarker
2024-07-19 16:10:51 +09:00
Author: https://github.com/awesomekling
Commit: 19b9401487
10 changed files with 60 additions and 40 deletions
VirtualFileSystem
|
@ -147,11 +147,11 @@ bool SyntheticFileSystem::enumerateDirectoryInode(InodeIdentifier inode, Functio
|
|||
if (!synInode.metadata.isDirectory())
|
||||
return false;
|
||||
|
||||
callback({ ".", synInode.metadata.inode });
|
||||
callback({ "..", synInode.parent });
|
||||
callback({ ".", 1, synInode.metadata.inode, 2 });
|
||||
callback({ "..", 2, synInode.parent, 2 });
|
||||
|
||||
for (auto& child : synInode.children)
|
||||
callback({ child->name, child->metadata.inode });
|
||||
callback({ child->name.characters(), child->name.length(), child->metadata.inode, child->metadata.isDirectory() ? (byte)2 : (byte)1 });
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue