Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When using sd2vita, sceIoMkdir becomes very slow #30

Open
blastrock opened this issue Dec 25, 2018 · 0 comments
Open

When using sd2vita, sceIoMkdir becomes very slow #30

blastrock opened this issue Dec 25, 2018 · 0 comments

Comments

@blastrock
Copy link

I have made some tests on sceIoMkdir and I get the following results:

  • sceIoOpen("ux0:somefile", SCE_O_CREAT|SCE_O_WRONLY) with or without sd2vita => 2ms
  • sceIoMkdir("ux0:data", 06) or any folder that already exists => 2ms
  • sceIoMkdir("ur0:test", 06) => 40ms
  • sceIoMkdir("ux0:test", 06) without sd2vita and StorageMgr or gamesd => 40ms
  • sceIoMkdir("ux0:test", 06) with sd2vita and StorageMgr or gamesd => 250 ms or more

This issue causes massive download speed drops in pkgj for games that contains hundreds of folders and eventually lead to a download failure due to HTTP timeout. I am also wondering if these 250ms aren't spent doing a FS sync to the sdcard which may wear it out sooner than necessary.

I tried a couple things. Replacing

static SceIoDevice uma_ux0_dev = { "ux0:", "exfatux0", "sdstor0:gcd-lp-ign-entire", "sdstor0:gcd-lp-ign-entire", MOUNT_POINT_ID };

with

static SceIoDevice uma_ux0_dev = { "ux0:", "exfatux0", "sdstor0:gcd-lp-ign-entire", NULL, MOUNT_POINT_ID };

Because that's what the structure looks like before being replaced. It did not help.

I also tried using sdstor0:gcd-lp-act-entire because that's a string that appears in the exfat kernel module.

Here is the small c++ snippet I used to benchmark mkdir:

void testmkdir(char const* path, int mode)
{
    sceIoRmdir(path);
    auto const start = std::chrono::high_resolution_clock::now();
    int err = sceIoMkdir(path, mode);
    auto const end = std::chrono::high_resolution_clock::now();
    auto const total =
            std::chrono::duration_cast<std::chrono::milliseconds>(end - start)
                    .count();

    if (err < 0)
        LOGF("sceIoMkdir({}, {:x}) time: {} failed: {:#08x}",
             path,
             mode,
             total,
             static_cast<uint32_t>(err));
    else
        LOGF("sceIoMkdir({}, {:x}) time: {} success", path, mode, total);
}

Related issue: TeamFAPS/PSVita-StorageMgr#54

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant