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

[3.0][GCD=ux0]When using sd2vita, sceIoMkdir becomes very slow #54

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

[3.0][GCD=ux0]When using sd2vita, sceIoMkdir becomes very slow #54

blastrock opened this issue Dec 25, 2018 · 3 comments
Labels
bug Something isn't working

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 (on the gamesd plugin, not this one, they are similar though). 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);
}
@CelesteBlue-dev
Copy link
Contributor

Is ux0: the memcard or the SD2VITA ?
Maybe your microSD is slower than official memcards...

@blastrock
Copy link
Author

blastrock commented Dec 25, 2018

ux0: is the sd2vita, or the internal memory, depending on the test. When it's the sd2vita it takes 250ms. The problem is specific to mkdir, so I don't think the issue is with the sd card. It also works fine when plugged in a computer.

@CelesteBlue-dev CelesteBlue-dev changed the title When using sd2vita, sceIoMkdir becomes very slow [3.0][GCD=ux0]When using sd2vita, sceIoMkdir becomes very slow Jan 11, 2020
@CelesteBlue-dev CelesteBlue-dev added the bug Something isn't working label Jan 11, 2020
@CelesteBlue-dev
Copy link
Contributor

Happens in gamesd too (see xyzz/gamecard-microsd#30) so it is directly related to the way the sd2vita (GCD) patch is done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant