mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-27 14:58:46 +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
|
@ -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