Homebrew Question Slow launching of homebrew

cathor

Well-Known Member
OP
Newcomer
Joined
Oct 15, 2016
Messages
78
Trophies
0
Age
37
XP
1,119
Country
Hi,

All of a sudden certain homebrew takes very long to load. It, started with retroarch which now takes about a minute to launch. Switching cores also takes about a minute as they are separate homebrew. Yesterday I noticed that kosmos toolbox also takes about a minute to launch. Used to be instant. Other homebrew still work like they should.

I am running FW 8.1.0 / Kosmos / 512GB FAT32. Tried launching homebrew in both Applet and non-applet mode.

Very annoying issue, have anyone else experienced this?

Cheers,
 

grcd

Well-Known Member
Member
Joined
Sep 14, 2009
Messages
166
Trophies
1
XP
587
Country
Could the media be failing?

I would try copying everything to a newly formatted drive and see if this fixes things.
 
Last edited by grcd,

cathor

Well-Known Member
OP
Newcomer
Joined
Oct 15, 2016
Messages
78
Trophies
0
Age
37
XP
1,119
Country
Could the hard disk drive be very fragmented, or failing?

I would try copying everything to a newly formatted drive and see if this fixes everything. You can also try defragging the existing drive, but better to do a backup first just in case.

Thanks. Yeah, that is an option. Not super excited about backing up 300GB+ though. Funny thing is, this has happened to me before, on a different card before I upgraded to a bigger one. Switching cards solved it. I must be doing something wrong cause I haven't read a single thread about this issue. Not doing anything out of the ordinary I would say, standard usage according to me. Emulators and backups...

Cheers,
 

grcd

Well-Known Member
Member
Joined
Sep 14, 2009
Messages
166
Trophies
1
XP
587
Country
Actually, my advice is terrible. I thought I was on the Wii board, so I presumed WBFS-related fragmentation. SD cards do not become fragmented in this way at all. However, an SD card issue is still the most likely culprit.

It could also be some issue with your setup, so I would reinstall Kosmos from a fresh SD. Alternatively, if you use emuMMC this is known to happen, depending on the speed of the card.
 

cathor

Well-Known Member
OP
Newcomer
Joined
Oct 15, 2016
Messages
78
Trophies
0
Age
37
XP
1,119
Country
Yeah, might have to do that. Problem is, with my history I feel I will run into this problem again after a month or two. Would be great to figure out what is causing it. Otherwise I will spend more time reinstalling than actually playing games.

No emuMMC here, doing it cowboy style.

Cheers,
 

cathor

Well-Known Member
OP
Newcomer
Joined
Oct 15, 2016
Messages
78
Trophies
0
Age
37
XP
1,119
Country
Hi,

Back again with the same issue. Installed PPSSPP Standalone yesterday and now both PPSSPP and retroarch takes over 1 minute to launch. Was back to normal for a long while. Can't remember how it got fixed, can't recall I reinstalled atmosphere. Might have been when I updated it. Anyways, back to sluggish loading. Anyone else had this problem?

Cheers,
 

The Real Jdbye

*is birb*
Member
Joined
Mar 17, 2010
Messages
23,207
Trophies
4
Location
Space
XP
13,733
Country
Norway
Hi,

Back again with the same issue. Installed PPSSPP Standalone yesterday and now both PPSSPP and retroarch takes over 1 minute to launch. Was back to normal for a long while. Can't remember how it got fixed, can't recall I reinstalled atmosphere. Might have been when I updated it. Anyways, back to sluggish loading. Anyone else had this problem?

Cheers,
SD card fragmentation is a likely culprit. Do not defragment flash storage though, it has a negative impact on the lifetime. Instead, copy everything off the card, format it and copy the files back on. It may be slower that way, and you need a lot of free space on your PC, but it's really the only way to do it.
While you are formatting the card, may as well make sure you format it with 64k cluster size (FAT32) as that slightly increases the speed.
 

cathor

Well-Known Member
OP
Newcomer
Joined
Oct 15, 2016
Messages
78
Trophies
0
Age
37
XP
1,119
Country
SD card fragmentation is a likely culprit. Do not defragment flash storage though, it has a negative impact on the lifetime. Instead, copy everything off the card, format it and copy the files back on. It may be slower that way, and you need a lot of free space on your PC, but it's really the only way to do it.
While you are formatting the card, may as well make sure you format it with 64k cluster size (FAT32) as that slightly increases the speed.

Ok, thanks! Guess i’ll do that then.

What’s usually the cause of fragmentation? Apart from read/write. Is copying over FTP more prone to cause fragmentation compared to removing the card and using a card reader?

Cheers,
 

TomSwitch

Well-Known Member
Member
Joined
Jan 10, 2019
Messages
4,348
Trophies
1
Age
44
XP
14,218
Country
United States
Could be HW failing or contact issue with SD card. SD card has a one bit mode. It is very slow and old version of hekate actually won't work with 1 bit mode but newer version has included compatibility with one bit mode. If you go find that old version and it fail on your machine it may be indicating that your HW is having problem.
 
Last edited by TomSwitch,

cathor

Well-Known Member
OP
Newcomer
Joined
Oct 15, 2016
Messages
78
Trophies
0
Age
37
XP
1,119
Country
Could be HW failing or contact issue with SD card. SD card has a one bit mode. It is very slow and old version of hekate actually won't work with 1 bit mode but newer version has included compatibility with one bit mode. If you go find that old version and it fail on your machine it may be indicating that your HW is having problem.

Thanks for the info. When you say hardware. Are you referring to the switch or the sdcard? But if reinstalling and formatting the whole card like suggested solves the problem, that would indicate a problem with the file structure and not hw issues right?

cheers
 

TomSwitch

Well-Known Member
Member
Joined
Jan 10, 2019
Messages
4,348
Trophies
1
Age
44
XP
14,218
Country
United States
Thanks for the info. When you say hardware. Are you referring to the switch or the sdcard? But if reinstalling and formatting the whole card like suggested solves the problem, that would indicate a problem with the file structure and not hw issues right?

cheers
Hard to say. Maybe just by taking it in and out you already solve the contact problem. SD card don't have a fragmentation problem. Nand cell can fail and before it completely fail error rate may increase and when the error rate can be fixed by error correction hardware some extra time is spend correcting the error so the fetch is slower ( while I can't tell you how much it slows it down my gut feeling is it is probably not to the extend that you can feel it ). There are spare cells which is there to replace failed cells, when these spare cells are involved there is slow down too (again I think not likely to be the reason to a dramatic slow down that you can see).
 
Last edited by TomSwitch,
  • Like
Reactions: RednaxelaNnamtra

cathor

Well-Known Member
OP
Newcomer
Joined
Oct 15, 2016
Messages
78
Trophies
0
Age
37
XP
1,119
Country
Hard to say. Maybe just by taking it in and out you already solve the contact problem. SD card don't have a fragmentation problem. Nand cell can fail and before it completely fail error rate may increase and when the error rate can be fixed by error correction hardware some extra time is spend correcting the error so the fetch is slower ( while I can't tell you how much it slows it down my gut feeling is it is probably not to the extend that you can feel it ). There are spare cells which is there to replace failed cells, when these spare cells are involved there is slow down too (again I think not likely to be the reason to a dramatic slow down that you can see).

ok, cool. But backups installed to sd boot and load normally, only homebrew affected. Isn’t that weird?
 

The Real Jdbye

*is birb*
Member
Joined
Mar 17, 2010
Messages
23,207
Trophies
4
Location
Space
XP
13,733
Country
Norway
Ok, thanks! Guess i’ll do that then.

What’s usually the cause of fragmentation? Apart from read/write. Is copying over FTP more prone to cause fragmentation compared to removing the card and using a card reader?

Cheers,
Deleting files leads to fragmentation.
Hard to say. Maybe just by taking it in and out you already solve the contact problem. SD card don't have a fragmentation problem. Nand cell can fail and before it completely fail error rate may increase and when the error rate can be fixed by error correction hardware some extra time is spend correcting the error so the fetch is slower ( while I can't tell you how much it slows it down my gut feeling is it is probably not to the extend that you can feel it ). There are spare cells which is there to replace failed cells, when these spare cells are involved there is slow down too (again I think not likely to be the reason to a dramatic slow down that you can see).
Flash memory does suffer when there is a lot of fragmentation. Random access speeds are not as bad as a HDD, but still pretty bad.
 

TomSwitch

Well-Known Member
Member
Joined
Jan 10, 2019
Messages
4,348
Trophies
1
Age
44
XP
14,218
Country
United States
Deleting files leads to fragmentation.

Flash memory does suffer when there is a lot of fragmentation. Random access speeds are not as bad as a HDD, but still pretty bad.
Nand cell are access by rows and columns. The row need to be energized first then the column address is put up for a read. If the next access is on the same row then some time is saved. This does not amount to a significant amount of time. Anyway there is no way for a user to optimize this as physical address and logical address is different. User can only see the logical address. The physical address is hidden inside the chip and not accessible. The reason for having this is wear leveling. User may repeatedly write to the same logical address and that will destroy the cell if logical and physical address is the same.

Deleting files making the nand slower can happen by a different mechanism. Programming Nand is either a one step or two step process. The cells needs to be all ones (erased state) before content can be written. A new flash have all cells in the erased state when it ship from the factory. When a file is deleted the erase process isn't performed until content needs to be written. If you have a relatively new flash and you never delete anything that means when you write you are always writing to cell that are already in the erased state and therefore faster.
 
Last edited by TomSwitch,
  • Like
Reactions: RednaxelaNnamtra

The Real Jdbye

*is birb*
Member
Joined
Mar 17, 2010
Messages
23,207
Trophies
4
Location
Space
XP
13,733
Country
Norway
Nand cell are access by rows and columns. The row need to be energized first then the column address is put up for a read. If the next access is on the same row then some time is saved. This does not amount to a significant amount of time. Anyway there is no way for a user to optimize this as physical address and logical address is different. User can only see the logical address. The physical address is hidden inside the chip and not accessible. The reason for having this is wear leveling. User may repeatedly write to the same logical address and that will destroy the cell if logical and physical address is the same.

Deleting files making the nand slower can happen by a different mechanism. Programming Nand is either a one step or two step process. The cells needs to be all ones (erased state) before content can be written. A new flash have all cells in the erased state when it ship from the factory. When a file is deleted the erase process isn't performed until content needs to be written. If you have a relatively new flash and you never delete anything that means when you write you are always writing to cell that are already in the erased state and therefore faster.
You may think that, but have a look at random read/write speeds in any benchmark program. The speed completely tanks down to only a few MB/s, if that.
Random example taken from my screenshots folder (and this is from a SSD, SD cards have it way worse): https://www.dropbox.com/s/87t3xg3svhaxofs/Screenshot 2019-06-26 20.24.39.png?dl=0
 
Last edited by The Real Jdbye,

TomSwitch

Well-Known Member
Member
Joined
Jan 10, 2019
Messages
4,348
Trophies
1
Age
44
XP
14,218
Country
United States

cathor

Well-Known Member
OP
Newcomer
Joined
Oct 15, 2016
Messages
78
Trophies
0
Age
37
XP
1,119
Country
sounds like an interesting topic, maybe worth it’s own thread.

Fragmentation or not, isn’t it weird that only homebrew is affected?

Haven’t done any major deleting of files lately. I’ve overwritten RA a few times when updating. Uninstalled a title or two.

Also, it’s not a gradual increase in loading time. From one day to another it jumps from from 2 seconds to 60+ seconds.

cheers,
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    LeoTCK @ LeoTCK: yes for nearly a month i was officially a wanted fugitive, until yesterday when it ended