Live data from Hacker News

Show HN: I missed the moving blocks, so I built a real Linux disk defragmenter

github.com

31–40 of 78 posts

Re: Show HN: I missed the moving blocks, so I built a real Linux disk defragmenter

#31
post #19

Earlier quoted context omitted.

Sequential reads are faster for SSDs. As long as defragmentation is reducing the chance of doing a random read, it is beneficial.

Is it possible to determine which sectors are physically sequential given remapping for wear-leveling? Otherwise the claimed defragmentation here is not actually resulting in sequential data.

>Otherwise the claimed defragmentation here is not actually resulting in sequential data.

I haven't measured it but the SSD firmware should be able to look up where the next block is speculatively in order to be able to immediately start sending it if the host tries and read the next block (as opposed to a random one).

Re: Show HN: I missed the moving blocks, so I built a real Linux disk defragmenter

#32

Earlier quoted context omitted.

iOS has never worked the way you are describing. It's easy to disprove your claim that the app is killed by just switching between different apps you have open. iOS keeps the apps open to make it fast to switch back to them.

Well, it closes the apps somewhat arbitrarily, but they definitely arent all open. If the most recent app is a resource-intensive game or something it will more aggressively close things. but you can have more open if they are all lightweight apps. But the switcher shows every app ever opened and tries to pretend these apps aren't being closed. Right now for instance, i just checked and as best i can tell, the last 3…

I do this also - but wonder because I'll have some app open, phone gets warm. Close the app and it cools down.

Re: Show HN: I missed the moving blocks, so I built a real Linux disk defragmenter

#33

Earlier quoted context omitted.

Except for some backups, all of my machines use solid state storage so I don't think there is a point for most people, is there?

Sequential reads are faster for SSDs. As long as defragmentation is reducing the chance of doing a random read, it is beneficial.

OH! TIL! Apparently

                                contiguous              fragmented
    -------------------------------------------------------------------
    PCIe 4.0 NVMe Read Speed    ~5,000 – 7,000 MB/s     ~80 – 250 MB/s
    SATA 3.0 SSD Read Speed     ~500 – 550 MB/s         ~30 – 60 MB/s

Still, given SSDs have a lifespan and given few of my files are that large, I think I'm personally okay without defragmenting. Those numbers are impressive but, most of 10s of thousands of files are source code text files. Asking online what the real-world loss is from not defragmenting

> You are giving up virtually 0% to 3% of real-world performance. In daily development, media editing, and standard system use, defragmenting your SSD will yield no human-noticeable speedup.

Re: Show HN: I missed the moving blocks, so I built a real Linux disk defragmenter

#34

Earlier quoted context omitted.

> My partner complains about me closing apps on my phone consistently. I'd be curious to know the reqson why she would care on her own phone and why it would be an issue on someone else's phone?

At least on iPhone, it basically doesn't do anything. Apple aggressively kills all background apps automatically. the "open" apps in the switcher are almost always just screenshots of previously-open-but-now-closed apps. if it was recent, the latest app or two in the switcher might actually be open, but rarely more than that. Despite this, many of my relatives have somehow learned this habit of opening the switcher a…

Android has always been quite vigilant and is prompt to kill off any app at the MFA login screen while I am consulting the Oracle of Authenticator in another task. Thanks Android!

That being said, I dislike having 3 dozen apps open because I simply can’t quickly find and switch to the ones I’m using. So when I enter a new situation, I swipe all the way left, and Clear All apps, to start over with a tabula rasa.

Re: Show HN: I missed the moving blocks, so I built a real Linux disk defragmenter

#35
Would be really cool to see two things.

First some kind of before and after benchmark, so you can actually see if defragging made a difference. Second is a recommendation for defragging based on things like the fragmentation, free space, and whether it’s an HDD or SSD.

Especially the second one feels useful since defragging doesn’t necessarily mean improvement to the system as you said yourself.

Re: Show HN: I missed the moving blocks, so I built a real Linux disk defragmenter

#36

Earlier quoted context omitted.

I feel so seen right now. My partner complains about me closing apps on my phone consistently. I also have to hold myself back from defragging and continually cleaning up my storage drives. I too am nearly certain that the positive benefits are approaching nil, but I still feel it should be helpful.

When you die, you will leave behind nice orderly contiguous files. It's thoughtful. hehe

After digging through a recently passed relative’s hard drive (the computer barely functioned so I pulled it) and having to search through years of garbage that where never deleted to find the photos, Word documents, and WordPerfect documents my aunt ‘knew’ where stored there somewhere, this is not an insignificant gift to leave my family with.

Re: Show HN: I missed the moving blocks, so I built a real Linux disk defragmenter

#37
post #2

Beautiful. Defragmenting my drives manually is one of those things like closing apps on my phone I am not using. Everyone says there is no need to do it. It might even be slightly worse overall. I even have enough self control to avoid doing it and have for years... But deep down in my heart, I truly FEEL like if I did it would improve things... somehow.

I feel so seen right now. My partner complains about me closing apps on my phone consistently. I also have to hold myself back from defragging and continually cleaning up my storage drives. I too am nearly certain that the positive benefits are approaching nil, but I still feel it should be helpful.

[flagged]

Re: Show HN: I missed the moving blocks, so I built a real Linux disk defragmenter

#38

Earlier quoted context omitted.

iOS has never worked the way you are describing. It's easy to disprove your claim that the app is killed by just switching between different apps you have open. iOS keeps the apps open to make it fast to switch back to them.

Well, it closes the apps somewhat arbitrarily, but they definitely arent all open. If the most recent app is a resource-intensive game or something it will more aggressively close things. but you can have more open if they are all lightweight apps. But the switcher shows every app ever opened and tries to pretend these apps aren't being closed. Right now for instance, i just checked and as best i can tell, the last 3…

Being able to go back 3 already contradicts the claim that it was rare to be more than 2. It works the same as Android. Android kills apps based off of resource usage but keeps screenshots of them in the task switcher.

Re: Show HN: I missed the moving blocks, so I built a real Linux disk defragmenter

#39
post #27

Earlier quoted context omitted.

iOS has never worked the way you are describing. It's easy to disprove your claim that the app is killed by just switching between different apps you have open. iOS keeps the apps open to make it fast to switch back to them.

This is literally always how iOS has worked. You can refer to the application lifecycle documentation: https://developer.apple.com/documentation/uikit/managing-you...

What point are you trying to make. The documentation doesn't say the OS only keeps a single app process running at a time.

Re: Show HN: I missed the moving blocks, so I built a real Linux disk defragmenter

#40
post #2

Beautiful. Defragmenting my drives manually is one of those things like closing apps on my phone I am not using. Everyone says there is no need to do it. It might even be slightly worse overall. I even have enough self control to avoid doing it and have for years... But deep down in my heart, I truly FEEL like if I did it would improve things... somehow.

If it makes it feel faster, it makes it feel faster.

It's like those copper bangles with magnets that people swear makes their joints less creaky.

My example is a daith piercing, that's when you pierce a ring through a fold of cartilage in a certain spot inside your ear. It's supposed to stop you getting migraines, but there's no sensible mechanism for this to work. It's all woo and bunkum, apparently.

But I've had four migraines in eight years as opposed to four every month.

So, if it feels faster, it might well be.

Post reply on HN