Code Monkey home page Code Monkey logo

Comments (1)

shundhammer avatar shundhammer commented on July 4, 2024

It becomes clearer when we see a bit more context:

hard-linked-small-files

So we have a lot of small files that all consume one cluster (4k), so the other rule comes into play:

https://github.com/shundhammer/qdirstat/blob/master/src/FileInfoSorter.cpp#L40-L47

if ( a->totalAllocatedSize() == b->totalAllocatedSize() )
{
    // This is a common case because of cluster-wise allocation
    return a->totalSize() < b->totalSize();
}
else
    return a->totalAllocatedSize() < b->totalAllocatedSize();

All those tiny files are sorted by their totalSize(), the byte size because their totalAllocatedSize() is the same every time: 4k, so you see them sorted by the few bytes of their nominal size.

But when compared with the files with multiple hard links, their totalSize() is no longer the same: Because the files with only one hard link still have one cluster (4k), while those with multiple hard links share that one cluster between all their hard links, so it's actually less than that one cluster; in this example one cluster divided by their two links, i.e. 4k / 2 = 2k.

That might be a bit irritating because it looks like there is a jump in the sorting, but it's really consistent.

from qdirstat.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.