Fragmentation is not a WBFS problem!

Discussion in 'Wii - Backup Loaders' started by Wiimm, Mar 3, 2010.

  1. Wiimm
    OP

    Wiimm Developer

    Member
    2,159
    368
    Aug 11, 2009
    Gambia, The
    Germany
    Fragmentation is not a WBFS problem!

    I have made some tests with WBFS fragmentation. My opinion is:
    • Because of the large WBFS blocks (8 MB on a 500 GB drive) the is no problem with fragmented discs.
    To verify my assertion I have made a test:[*] Initialize a WBFS device.[*] Create several discs, all of size 4 GiB.[*] All but one discs use continous blocks.[*] 1 disc is splitted into 16 fragments of 256 MiB. The space between this fragments is 4 GiB.This is the memory map of my test device (WBFS blocksize = 2 MiB):
    Code:
    ÂÂÂÂ unused :ÂÂ off(beg) ..ÂÂ off(end) :ÂÂÂÂÂÂsize : info
    ÂÂ--------------------------------------------------------------------------------------
    ÂÂÂÂÂÂÂÂÂÂÂÂ:ÂÂÂÂ 200000 ..ÂÂ 10200000 :ÂÂ10000000 :ÂÂ128 blocks -> disc #000ÂÂÂÂ[PHT000]
    ÂÂÂÂÂÂÂÂÂÂÂÂ:ÂÂ 10200000 ..ÂÂ110200000 : 100000000 : 2048 blocks -> disc #001ÂÂÂÂ[PHT001]
    ÂÂÂÂÂÂÂÂÂÂÂÂ:ÂÂ110200000 ..ÂÂ120200000 :ÂÂ10000000 :ÂÂ128 blocks -> disc #000.1ÂÂ[PHT000]
    ÂÂÂÂÂÂÂÂÂÂÂÂ:ÂÂ120200000 ..ÂÂ220200000 : 100000000 : 2048 blocks -> disc #003ÂÂÂÂ[PHT003]
    ÂÂÂÂÂÂÂÂÂÂÂÂ:ÂÂ220200000 ..ÂÂ230200000 :ÂÂ10000000 :ÂÂ128 blocks -> disc #000.2ÂÂ[PHT000]
    ÂÂÂÂÂÂÂÂÂÂÂÂ:ÂÂ230200000 ..ÂÂ330200000 : 100000000 : 2048 blocks -> disc #005ÂÂÂÂ[PHT005]
    ÂÂÂÂÂÂÂÂÂÂÂÂ:ÂÂ330200000 ..ÂÂ340200000 :ÂÂ10000000 :ÂÂ128 blocks -> disc #000.3ÂÂ[PHT000]
    ÂÂÂÂÂÂÂÂÂÂÂÂ:ÂÂ340200000 ..ÂÂ440200000 : 100000000 : 2048 blocks -> disc #007ÂÂÂÂ[PHT007]
    ÂÂÂÂÂÂÂÂÂÂÂÂ:ÂÂ440200000 ..ÂÂ450200000 :ÂÂ10000000 :ÂÂ128 blocks -> disc #000.4ÂÂ[PHT000]
    ÂÂÂÂÂÂÂÂÂÂÂÂ:ÂÂ450200000 ..ÂÂ550200000 : 100000000 : 2048 blocks -> disc #009ÂÂÂÂ[PHT009]
    ÂÂÂÂÂÂÂÂÂÂÂÂ:ÂÂ550200000 ..ÂÂ560200000 :ÂÂ10000000 :ÂÂ128 blocks -> disc #000.5ÂÂ[PHT000]
    ÂÂÂÂÂÂÂÂÂÂÂÂ:ÂÂ560200000 ..ÂÂ660200000 : 100000000 : 2048 blocks -> disc #011ÂÂÂÂ[PHT011]
    ÂÂÂÂÂÂÂÂÂÂÂÂ:ÂÂ660200000 ..ÂÂ670200000 :ÂÂ10000000 :ÂÂ128 blocks -> disc #000.6ÂÂ[PHT000]
    ÂÂÂÂÂÂÂÂÂÂÂÂ:ÂÂ670200000 ..ÂÂ770200000 : 100000000 : 2048 blocks -> disc #013ÂÂÂÂ[PHT013]
    ÂÂÂÂÂÂÂÂÂÂÂÂ:ÂÂ770200000 ..ÂÂ780200000 :ÂÂ10000000 :ÂÂ128 blocks -> disc #000.7ÂÂ[PHT000]
    ÂÂÂÂÂÂÂÂÂÂÂÂ:ÂÂ780200000 ..ÂÂ880200000 : 100000000 : 2048 blocks -> disc #015ÂÂÂÂ[PHT015]
    ÂÂÂÂÂÂÂÂÂÂÂÂ:ÂÂ880200000 ..ÂÂ890200000 :ÂÂ10000000 :ÂÂ128 blocks -> disc #000.8ÂÂ[PHT000]
    ÂÂÂÂÂÂÂÂÂÂÂÂ:ÂÂ890200000 ..ÂÂ990200000 : 100000000 : 2048 blocks -> disc #017ÂÂÂÂ[PHT017]
    ÂÂÂÂÂÂÂÂÂÂÂÂ:ÂÂ990200000 ..ÂÂ9a0200000 :ÂÂ10000000 :ÂÂ128 blocks -> disc #000.9ÂÂ[PHT000]
    ÂÂÂÂÂÂÂÂÂÂÂÂ:ÂÂ9a0200000 ..ÂÂaa0200000 : 100000000 : 2048 blocks -> disc #019ÂÂÂÂ[PHT019]
    ÂÂÂÂÂÂÂÂÂÂÂÂ:ÂÂaa0200000 ..ÂÂab0200000 :ÂÂ10000000 :ÂÂ128 blocks -> disc #000.10 [PHT000]
    ÂÂÂÂÂÂÂÂÂÂÂÂ:ÂÂab0200000 ..ÂÂbb0200000 : 100000000 : 2048 blocks -> disc #021ÂÂÂÂ[PHT021]
    ÂÂÂÂÂÂÂÂÂÂÂÂ:ÂÂbb0200000 ..ÂÂbc0200000 :ÂÂ10000000 :ÂÂ128 blocks -> disc #000.11 [PHT000]
    ÂÂÂÂÂÂÂÂÂÂÂÂ:ÂÂbc0200000 ..ÂÂcc0200000 : 100000000 : 2048 blocks -> disc #023ÂÂÂÂ[PHT023]
    ÂÂÂÂÂÂÂÂÂÂÂÂ:ÂÂcc0200000 ..ÂÂcd0200000 :ÂÂ10000000 :ÂÂ128 blocks -> disc #000.12 [PHT000]
    ÂÂÂÂÂÂÂÂÂÂÂÂ:ÂÂcd0200000 ..ÂÂdd0200000 : 100000000 : 2048 blocks -> disc #025ÂÂÂÂ[PHT025]
    ÂÂÂÂÂÂÂÂÂÂÂÂ:ÂÂdd0200000 ..ÂÂde0200000 :ÂÂ10000000 :ÂÂ128 blocks -> disc #000.13 [PHT000]
    ÂÂÂÂÂÂÂÂÂÂÂÂ:ÂÂde0200000 ..ÂÂee0200000 : 100000000 : 2048 blocks -> disc #027ÂÂÂÂ[PHT027]
    ÂÂÂÂÂÂÂÂÂÂÂÂ:ÂÂee0200000 ..ÂÂef0200000 :ÂÂ10000000 :ÂÂ128 blocks -> disc #000.14 [PHT000]
    ÂÂÂÂÂÂÂÂÂÂÂÂ:ÂÂef0200000 ..ÂÂff0200000 : 100000000 : 2048 blocks -> disc #029ÂÂÂÂ[PHT029]
    ÂÂÂÂÂÂÂÂÂÂÂÂ:ÂÂff0200000 .. 1000200000 :ÂÂ10000000 :ÂÂ128 blocks -> disc #000.15 [PHT000]
    ÂÂÂÂÂÂÂÂÂÂÂÂ: 1000200000 .. 1100200000 : 100000000 : 2048 blocks -> disc #031ÂÂÂÂ[PHT031]
    • The disc PHT000 is a fragmented disc.
    • The disc PHT001 is a *not* fragmented at the beginning of the partition.
    • The disc PHT017 is a *not* fragmented at the middle between PHT001 and PHT031
    • The disc PHT031 is a *not* fragmented at the offset 64 GiB (in the middle) of the partition.
    And this are the read times (copy to /dev/null) for the 4 discs:
    CODEextract PHT000 ... 112 sec
    extract PHT001 ... 104 sec
    extract PHT017 ... 113 sec
    extract PHT031 ... 127 sec

    extract PHT000 ... 113 sec
    extract PHT001 ... 104 sec
    extract PHT017 ... 113 sec
    extract PHT031 ... 127 sec

    extract PHT000 ... 113 sec
    extract PHT001 ... 104 sec
    extract PHT017 ... 113 sec
    extract PHT031 ... 126 sec

    extract PHT000 ... 113 sec
    extract PHT001 ... 104 sec
    extract PHT017 ... 113 sec
    extract PHT031 ... 127 sec

    extract PHT000 ... 113 sec
    extract PHT001 ... 104 sec
    extract PHT017 ... 113 sec
    extract PHT031 ... 127 sec

    extract PHT000 ... 112 sec
    extract PHT001 ... 104 sec
    extract PHT017 ... 114 sec
    extract PHT031 ... 126 sec

    extract PHT000 ... 113 sec
    extract PHT001 ... 104 sec
    extract PHT017 ... 113 sec
    extract PHT031 ... 127 sec

    extract PHT000 ... 112 sec
    extract PHT001 ... 104 sec
    extract PHT017 ... 113 sec
    extract PHT031 ... 127 sec

    extract PHT000 ... 113 sec
    extract PHT001 ... 103 sec
    extract PHT017 ... 113 sec
    extract PHT031 ... 127 sec

    extract PHT000 ... 113 sec
    extract PHT001 ... 104 sec
    extract PHT017 ... 113 sec
    extract PHT031 ... 127 sec

    ---------- SUM ----------

    PHT001:ÂÂ1039 sec / 10 == 103 sec
    PHT000:ÂÂ1127 sec / 10 == 112 sec &2
    ÂÂÂÂexit 1
    fi

    {
    ÂÂÂÂprintf '\n---------- INIT ----------\n\n'

    ÂÂÂÂwwt init $dev -qf
    ÂÂÂÂrmlist=""
    ÂÂÂÂfor ((i=0;i$log
    rm -f $log.tmp
     
  2. Cyan

    Cyan GBATemp's lurking knight

    Global Moderator
    18,043
    8,562
    Oct 27, 2002
    France
    Engine room, learning
    You already posted the same statement few weeks ago, but didn't included the speed test.
    I see with speed, it has no incidence either.
    Thank you for going fully into your tests and ideas, and letting us know what you found.

    I'm still using WBFS partition and I'm happy with it.
     
  3. Wiimm
    OP

    Wiimm Developer

    Member
    2,159
    368
    Aug 11, 2009
    Gambia, The
    Germany
    I was convinced by logical considerations, that fragmentation is not a problem. And today I proved it with the test above.
     
  4. ConJ

    ConJ The Toker

    Member
    919
    0
    Jul 18, 2008
    Glastonbury
    Thanks for posting your findings Wiimm.
     
  5. tueidj

    tueidj I R Expert

    Member
    2,569
    820
    Jan 8, 2009
    Now do the test again with random access instead of sequential.