mirror of
https://github.com/RGBCube/serenity
synced 2025-05-15 15:34: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
10 changed files with 60 additions and 40 deletions
|
@ -218,7 +218,7 @@ ssize_t FileDescriptor::get_dir_entries(byte* buffer, Unix::size_t size)
|
|||
m_vnode->vfs()->enumerateDirectoryInode(m_vnode->inode, [&stream] (auto& entry) {
|
||||
stream << (dword)entry.inode.index();
|
||||
stream << (byte)entry.fileType;
|
||||
stream << (dword)entry.name.length();
|
||||
stream << (dword)entry.name_length;
|
||||
stream << entry.name;
|
||||
return true;
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue