mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +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:
@@ -26,7 +26,6 @@
|
||||
#include "VirtualConsole.h"
|
||||
#include "Scheduler.h"
|
||||
|
||||
#define TEST_VFS
|
||||
#define KSYMS
|
||||
#define SPAWN_MULTIPLE_SHELLS
|
||||
//#define STRESS_TEST_SPAWNING
|
||||
@@ -103,7 +102,8 @@ static void loadKsyms(const ByteBuffer& buffer)
|
||||
// FIXME: The Strings here should be eternally allocated too.
|
||||
ksyms().append({ address, String(startOfName, bufptr - startOfName) });
|
||||
|
||||
kprintf("\033[u\033[s%u/%u", ksyms().size(), ksym_count);
|
||||
if ((ksyms().size() % 10) == 0 || ksym_count == ksyms().size())
|
||||
kprintf("\033[u\033[s%u/%u", ksyms().size(), ksym_count);
|
||||
++bufptr;
|
||||
}
|
||||
kprintf("\n");
|
||||
@@ -174,7 +174,6 @@ static void init_stage2()
|
||||
{
|
||||
Syscall::initialize();
|
||||
|
||||
#ifdef TEST_VFS
|
||||
auto vfs = make<VirtualFileSystem>();
|
||||
|
||||
auto dev_zero = make<ZeroDevice>();
|
||||
@@ -218,8 +217,6 @@ static void init_stage2()
|
||||
|
||||
vfs->mount(ProcFileSystem::the(), "/proc");
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef TEST_ELF_LOADER
|
||||
{
|
||||
auto testExecutable = vfs->open("/bin/id");
|
||||
|
||||
Reference in New Issue
Block a user