G:\Kanshiketsu_AES_sourcecode>dir

08/05/2021  03:50            84,480 Nakamichi_Vanilla_LITE_Kaidanji-Kanshiketsu_DD-128AES_ICC_64bit.exe
06/08/2021  10:43       300,000,000 test1_demo

G:\Kanshiketsu_AES_sourcecode>Kaidanjify-Kanshiketsu_DD-128AES_internal-64GB.bat test1_demo

G:\Kanshiketsu_AES_sourcecode>sha1sum "test1_demo"
8a87bea02c7f48686ef95796dbc19756af7af1b3  test1_demo

G:\Kanshiketsu_AES_sourcecode>timer64 Nakamichi_Vanilla_LITE_Kaidanji-Kanshiketsu_DD-128AES_ICC_64bit.exe "test1_demo" "test1_demo.Nakamichi" 24 50000 i

                                                            SMMi                                                                               :MM2
                                                           0MMMMM:                                                                            rMMMMMa
                                                          ZMMM. 0Z                                                                           :MMM7 7B
                                                         rMM@                                                                                MMM
         7                                               MMM                                                                                MMM.
       BMMMa XZ               :MM:                      MMM                                                                                XMMX
     XMSANMAYCE;             rMMMM                     rMM;                                                                                MM@
    WM0  2MMMMM             ZMMMM                      MMW                                                                                BMM
    :      MMMB           aMMMMW                      2MM                                                           :MM8                  MM7               8MMi
            MMMZ           XMMM                       MMa                                                         .WMMM0                 @MM              rMMMMi
            MMMMa           MM,                      aMM                                                          XMMB                   MM:              MMM2
           @MXMMM7         0MM                       MMS                                                                                WMM
           MM  MMM,        MM7                      7MM                                                                                 MM:
          MMX  ;MMM       iMM         MMM8  .       MM8     MMS         MMMZ  .     iMBi    :MMMX      @MMa      WB:       XMMZ2aX     ZMM     MMM2     :M2
         :MM    ZMMM      BM8       ;MMMMMaaMM     ,MM    XMM@MM      rMMMMM2aMM   XMMMM   SMMSMM.    MMXMMM    MMMM0     aMMMa@MMr    MMS   ;MM;MM8   XMMMM.
         MMr     MMM0     MM       2MMW    MMM     0MM   ZMS 2MM.    aMMB    MMM  BM aMM  8Ma  MM   iMM  BMM   M7 MMZ    ;MMX   MMi   ;MM   ZMW  MM0  rM 7MM
        ;MM       MMM7   iMM      ZMM2    0MMa     MMX  8M:  MMM    ZMMS    BMM2  7  MM8 ZMr  :MM  rMB   MM@     iMM     MMZ   iMM    WMW  BM2   MMX     @MM
        MMi       ;MMM   0MS     2MM7    aMMM     ;MM .8Mi  MMM    aMM7    ZMMM      MM ;Mr   XMM iM8    MMa     0MM    BMM    MMM    MM: BMX   .MM      MM7
       aMM         BMMM  MM     ;MMX    ZMMMZ     BM@ MMM    .    rMM7    ZMMMZ     :MM:MX    0MZ M8    XMM,     MMX    MM.    ;W:   rMM aMX    ZMM     7MM
       MM           MMMi MM     MMZ    8M:MM      MM; MMM,        MMa    0M:MM      8MWM8     MMZM0     MMM     rMM    0MM           WMa,M2     MMS     MM8
      @M0           :MMMXMa    MMM    WM XMB ;   :MM;M8MMM       MMM    @M XM0 ;    MMM@      MMMW      MMrZi   MMS    MMi           MMZM0     rMM Mi   MM :
     ;MM             BMMMM:   rMM    MM  MMSMa   ZMMM@ iMMr     7MM    MM  MMXM2   :MMM      ZMMM      8MM@@    MMZ0  7MM       ,   :MMMM      MMBMa   0MWBr
    ,MMMM             MMMM    MMS   MM   MMMZ    MMMM   MMM     MMS  .MM   MMMZ    @MM.      MMM       MMMM    WMM@   0MM      2M   ZMMM      :MMMa    MMM7
  iMMMMMM@            XMMM   .MM  XMM   aMMM     MMM:    MMW   .MM  XM@   ZMMM     MM0      aMMX      8MMM    .MMM    WMM     ZMr   MMMX      MMM8    0MMS
 SMMMMi                MMM,  rMM,MM2    MMM:    SMMM     ;MM2  ;MM,MMS    MMM,    MMM       MMM       MMM.    MMM     .MM    MMZ    MMM      XMMM    rMMB
 :MMM7                 MM@    BMMM      aMM     ;MMX      aMMX  8MMM      ZMM     MM8      .MMX      MMM2    iMMX      ,MMMMMMZ     .@;      MMM     WMM
    .                  .:                         :        0MMZ                                      .2Z                  :7r.                ;i
                                                            0MMMaSMi
                                                             aMMMM7
                                                              .WW

Nakamichi 'Kaidanji', written by Kaze, inspired by Haruhiko Okumura sharing, based on Nobuo Ito's LZSS source, muffinesque tips by m^2, Jim Dempsey and Kirill Kryukov enforced.
This latest (2021-Aug-04) compile has B-trees only matchfinder - called 'SUPRALITE'; Downloadable at: https://twitter.com/Sanmayce

Nakamichi 'Kaidanji' SUPRALITE highlights:

- Back to supersimplisticism - 'Kaidanji' returns refined. Simply, ripping only orders 4,6,8,10,12,14,16,18,36,64 and then quickly trying to expand the match in the found position.

Nakamichi 'Ryuugan-ditto-1TB'/'Dragoneye' LITE highlights:

- The Zennish LZSS Microdeduplicator, a texttoy (file-to-file [de]compressor) written in plain C, 100% FREE - licenseless it is;
- Single-threaded Non-SIMD console tool written entirely by yours truly Sanmayce;
- The first Lempel-Ziv-Storer-Szymanski (LZSS) compressor using 1TB sliding window;
- It targets superfast decompression of huge/tera corpora of textual data;

- LITE means no memmem() (Railgun) invocations are to be made, nah, back to minimalistic Railgun since 2021-Mar-12;
- Compressing at Linear Rate due to Matchfinding based on B-trees only;
- The Leprechaunesque (Internal/External) B-trees order 3 (2 keys MAX) are brutally-optimized;

- Ability to deduplicate (as little as) 64 bytes long chunks 1TB backwards;
- Ability to deduplicate 256[+] bytes long chunks 1TB backwards - when SHA3 enabled;

- CHUNKABLE! Since there are no headers/metadata in .Nakamichi files, arbitrary chunks/blocks can be compressed-n-concatenated;

- SCALABLE! Gets faster when more Physical or/and External RAM is available;
- Dynamical (as command line parameters) selection of HASH & B-trees memory blocks;
- AUTO-RESETTING PASSES (when TargetBuffer is filled then automaticaly restart building by doubling the passes);
- DEFRAGMENTED B-trees are in use during compression stage, their leaves contain only BBs appearing 2[+] times;

- Compileable under Windows and Linux, most suitable to run on 3TB machines;
- Many thanks go to: Haruhiko Okumura, Nobuo Ito, Hamid Buzidi, Landon Noll, J. Andrew Rogers, Aleksey Vaneev (https://github.com/avaneev/prvhash).

Sanmayce, Nakamichi's author, here, some more notes:

- The B-trees form the second layer, the first being HASH table handled by FNV1A-Pippip - the fastest lookup-hash;
- Hashpot a.k.a. hashpools (residing in Physical RAM) could be tuned via command line parameter, thus lessening the B-trees heights;
- The building of B-trees is done dynamically-n-automatically in PASSES, thus LOCALITY/LOCALIZATION leads to cache-friendliness, for example, instead of confusing/blinding
  the SSD controller with building 2^27 ~= 128M B-trees at a time, 'PASSES' revision lowers the "noise/mayhem" 128 times by processing e.g. (20bit) 1M B-trees at a time;

- For so long, the main goal was to throw it in battle, thus to forge one battle-ready *nix/windows tool with superb hash/search/decompress capabilities.
- Straight up, a wish of mine is to have the latest English Wikipedia XML dump decompressed by Nakamichi into physical RAM and then followed by Kazahana's superfast exact/wildcard/fuzzy etudes.
- Through the years, such a transparent decompressor (load booster) has been losing momentum and kinda became unnecessary, but not for me, when HDDs had 40MB/s sequential read speeds it was ...
  boosty, now with SSDs reading at 1700+MB/s, not so smacky, yet uploading (on 128GB machines, 20GB+72GB needed) the whole Wikipedia ~20GB (instead of 72GB) is better, sizewise.

- Currently, having 16 (4,6,8,10,12,14,16,18,36,64,24,28,48,56,128,256) MatchLens being hashed (plus 1 being phantomic/temporary), 29bit hashtable results in: (16+1)*8*(2^29) = (16+1)*8*(1<<29) =
  69632MB hashpot (the cluster of all hashpools), each slot houses a QWORD (being an offset/address of a B-tree root).
- In near future, wanna see a machine (256GB RAM) crunching the 77,265,813,300 bytes file with this command line (it requires 2x72GB + 68GB + 2930GB = 212GB physical RAM + 2.9TB SSD RAM):
  D:\>timer64 Nakamichi.exe enwiki-20200420-pages-articles.xml enwiki-20200420-pages-articles.xml.Nakamichi 29 3000000 e
- In not so far future, wanna see a machine (4096GB RAM) crunching the 72GB file with this command line (it requires 2x72GB + 272GB + 2930GB = 3.3TB physical RAM):
  D:\>timer64 Nakamichi.exe enwiki-20200420-pages-articles.xml enwiki-20200420-pages-articles.xml.Nakamichi 31 3000000 i

Q: - HOW TO BOOST [BUILDING/COMPRESSION] SPEED?
A: - Now, the name of the game is "RAM in spades", if we have a lot then speed is going to jump a lot. How?
- First, by increasing the hash-pool - 20 (number of bits) was used in 'Taishukan' resulting in 2^20 =~ 1M hash-slots a.k.a. B-trees' roots per keysize, naturally, the bigger the faster since B-trees will
  have less height and will be more - aiming to reach the ideal case - having only hash-slots with no actual B-trees! Back to 'Taishukan', the testfile is ~77MB, it suggests using 128M slots to lower
  height/branching of B-trees - 2^27 leads to using 27. Feartime, going from 20 to 27: 8*(15+1)*2^(20) = 134,217,793 bytes; with the speed-up hash needs 8*(15+1)*2^(27) = 17,179,869,184 bytes, yes 16GB.
- Second, by lowering passes in building the B-trees - the trick is to increase the number in compile-time parameter -DSpeedUpBuilding=32 - (didn't make it as an execute-time parameter, lazy).
  If we look at the 'Taishukan' console log it tells us that (Target-Buffer 106 MB) x 64 passes = 6784MB are needed for building the B-trees in ONE PASS ONLY, so compile with -DSpeedUpBuilding=6784 instead.

Enfun!

Current priority class is REALTIME_PRIORITY_CLASS.
This compile uses B-trees only, no memmem() invocations - it compresses worse but much faster.
Allocating Source-Buffer 286 MB ...
Allocating Target-Buffer 1,286 MB ...
Source-file-Hash(FNV1A_YoshimitsuTRIAD) = 0x53c2,98e3
Leprechaun: Memory pool for B-trees is 50,000 MB.
Leprechaun: In this revision 128MB 10-way hash is used which results in 10 x 16,777,216 internal B-Trees of order 3.
Leprechaun: Allocating HASH memory 1,476,395,073 bytes = 8*(10+1)*2^(24) ... OK
Leprechaun: Allocating memory for B-trees 50001 MB ... OK
Kanshiketsu: Allocating Speed-up Array Source-Buffer_Skip-Vector 300,000,000 Bytes ...
Leprechaun: Size of input file: 300,000,000

Leprechaun: Using (first 16 bytes of) DoubleDeuceAES for Matches 16+ long, in order to reduce memory footprint.
Leprechaun: Inserting keys/BBs of order 004 into B-trees, free RAM in B-tree pool is 00,050,000 MB; Pass #000,001 of 000,001 ... DONE; 00,002,165,167 DEFRAGMENTED B-trees have been rooted so far.
            2,317,998 TotalNonUnique (of length 004) keys have been inserted into DEFRAGMENTED B-trees.
Kanshiketsu: HowManyPositionsAreNonUnique (for current order) = 299,750,534
Leprechaun: Inserting keys/BBs of order 006 into B-trees, free RAM in B-tree pool is 00,049,896 MB; Pass #000,001 of 000,001 ... DONE; 00,011,773,639 DEFRAGMENTED B-trees have been rooted so far.
            14,265,502 TotalNonUnique (of length 006) keys have been inserted into DEFRAGMENTED B-trees.
Kanshiketsu: HowManyPositionsAreNonUnique (for current order) = 287,662,388
Leprechaun: Inserting keys/BBs of order 008 into B-trees, free RAM in B-tree pool is 00,049,305 MB; Pass #000,001 of 000,001 ...
Leprechaun: Failure! Increment 'Memory for B-trees'!
Automatically increasing number of passes in order to fit B-trees into Target Buffer.
Leprechaun: Inserting keys/BBs of order 008 into B-trees, free RAM in B-tree pool is 00,049,305 MB; Pass #000,001 of 000,002 ...
Leprechaun: Failure! Increment 'Memory for B-trees'!
Automatically increasing number of passes in order to fit B-trees into Target Buffer.
Leprechaun: Inserting keys/BBs of order 008 into B-trees, free RAM in B-tree pool is 00,048,418 MB; Pass #000,004 of 000,004 ... DONE; 00,025,257,385 DEFRAGMENTED B-trees have been rooted so far.
            27,331,856 TotalNonUnique (of length 008) keys have been inserted into DEFRAGMENTED B-trees.
Kanshiketsu: HowManyPositionsAreNonUnique (for current order) = 245,956,385
Leprechaun: Inserting keys/BBs of order 010 into B-trees, free RAM in B-tree pool is 00,047,051 MB; Pass #000,004 of 000,004 ... DONE; 00,039,373,862 DEFRAGMENTED B-trees have been rooted so far.
            30,890,705 TotalNonUnique (of length 010) keys have been inserted into DEFRAGMENTED B-trees.
Kanshiketsu: HowManyPositionsAreNonUnique (for current order) = 189,654,107
Leprechaun: Inserting keys/BBs of order 012 into B-trees, free RAM in B-tree pool is 00,045,687 MB; Pass #000,004 of 000,004 ... DONE; 00,052,852,569 DEFRAGMENTED B-trees have been rooted so far.
            27,289,914 TotalNonUnique (of length 012) keys have been inserted into DEFRAGMENTED B-trees.
Kanshiketsu: HowManyPositionsAreNonUnique (for current order) = 141,425,665
Leprechaun: Inserting keys/BBs of order 014 into B-trees, free RAM in B-tree pool is 00,044,474 MB; Pass #000,004 of 000,004 ... DONE; 00,065,187,356 DEFRAGMENTED B-trees have been rooted so far.
            22,295,576 TotalNonUnique (of length 014) keys have been inserted into DEFRAGMENTED B-trees.
Kanshiketsu: HowManyPositionsAreNonUnique (for current order) = 106,076,050
Leprechaun: Inserting keys/BBs of order 016 into B-trees, free RAM in B-tree pool is 00,043,427 MB; Pass #000,004 of 000,004 ... DONE; 00,076,229,296 DEFRAGMENTED B-trees have been rooted so far.
            18,012,916 TotalNonUnique (of length 016) keys have been inserted into DEFRAGMENTED B-trees.
Kanshiketsu: HowManyPositionsAreNonUnique (for current order) = 83,348,839
Leprechaun: Inserting keys/BBs of order 018 into B-trees, free RAM in B-tree pool is 00,042,542 MB; Pass #000,004 of 000,004 ... DONE; 00,086,118,633 DEFRAGMENTED B-trees have been rooted so far.
            14,938,413 TotalNonUnique (of length 018) keys have been inserted into DEFRAGMENTED B-trees.
Kanshiketsu: HowManyPositionsAreNonUnique (for current order) = 69,077,035
Leprechaun: Inserting keys/BBs of order 036 into B-trees, free RAM in B-tree pool is 00,042,035 MB; Pass #000,004 of 000,004 ... DONE; 00,091,451,324 DEFRAGMENTED B-trees have been rooted so far.
            6,417,762 TotalNonUnique (of length 036) keys have been inserted into DEFRAGMENTED B-trees.
Kanshiketsu: HowManyPositionsAreNonUnique (for current order) = 27,634,162
Leprechaun: Inserting keys/BBs of order 064 into B-trees, free RAM in B-tree pool is 00,041,778 MB; Pass #000,004 of 000,004 ... DONE; 00,094,416,222 DEFRAGMENTED B-trees have been rooted so far.
            3,261,762 TotalNonUnique (of length 064) keys have been inserted into DEFRAGMENTED B-trees.
Kanshiketsu: HowManyPositionsAreNonUnique (for current order) = 12,605,962

Histogram (rotate it 90 degrees clockwise) of Unique-Building-Blocks appearing 2[+] times (e.g. 'alfalfa-alfa' stream has 1 BB with length 4 appearing 3 times thus adding 1 to the count for {004]):
 3,261,762{064]
 6,417,762{036]
14,938,413{018]
18,012,916{016]
22,295,576{014]
27,289,914{012]
30,890,705{010]
27,331,856{008]
14,265,502{006]
 2,317,998{004]

Leprechaun: Total Searches-n-Inserts Per Second: 4,016,553 SNIPS = 5,992,697,656 keys in 1,492 seconds
Leprechaun: RAM needed to house B-trees (relative to the file being ripped): 28N = 8,274MB
Leprechaun: RAM needed to build B-trees IN ONE PASS: (Target-Buffer = 1,286 MB) x 4 passes = 5,144MB
Note: In case of RAM in spades then may use compile option: -DSpeedUpBuilding=5144

Compressing 300,000,000 bytes ...
/; Each rotation means 64KB are encoded; Speed: 0,265,251 B/s; Done 100%; Compression Ratio: 2.34:1; Matches(16/24/48): 1,578,470/0/5,314; 128[+] long matches: 15,909; ETA: 0.00 hours
NumberOfFullLiterals (lower-the-better): 100123
RAM-to-RAM performance: 265251 B/s.
Compressed to 128,125,394 bytes.
Source-file-Hash(FNV1A_YoshimitsuTRIAD) = 0x53c2,98e3
Target-file-Hash(FNV1A_YoshimitsuTRIAD) = 0xa9cb,5180


Kernel  Time =    73.609 =    2%
User    Time =  2598.031 =   97%
Process Time =  2671.640 =   99%    Virtual  Memory =  53372 MB
Global  Time =  2676.083 =  100%    Physical Memory =  34459 MB

G:\Kanshiketsu_AES_sourcecode>Nakamichi_Vanilla_LITE_Kaidanji-Kanshiketsu_DD-128AES_ICC_64bit.exe "test1_demo.Nakamichi" 1>"test1_demo.NKMCH"

G:\Kanshiketsu_AES_sourcecode>sha1sum "test1_demo.NKMCH"
8a87bea02c7f48686ef95796dbc19756af7af1b3  test1_demo.NKMCH

G:\Kanshiketsu_AES_sourcecode>dir "test1_demo.*"/os
 Volume in drive G is TERA-PIG_1TB
 Volume Serial Number is 4CAE-F7A5

 Directory of G:\Kanshiketsu_AES_sourcecode

08/05/2021  04:08       128,125,394 test1_demo.Nakamichi
08/05/2021  04:08       300,000,000 test1_demo.NKMCH
06/08/2021  10:43       300,000,000 test1_demo
               3 File(s)    728,125,394 bytes
               0 Dir(s)  52,584,869,888 bytes free

G:\Kanshiketsu_AES_sourcecode>Kaidanjify-Kanshiketsu_DD-128AES_internal-64GB.bat TERAPIG_TS100.txt

G:\Kanshiketsu_AES_sourcecode>sha1sum "TERAPIG_TS100.txt"
d32aa36818d08568294777f8a23cae52ff240d53  TERAPIG_TS100.txt

G:\Kanshiketsu_AES_sourcecode>timer64 Nakamichi_Vanilla_LITE_Kaidanji-Kanshiketsu_DD-128AES_ICC_64bit.exe "TERAPIG_TS100.txt" "TERAPIG_TS100.txt.Nakamichi" 24 50000 i

                                                            SMMi                                                                               :MM2
                                                           0MMMMM:                                                                            rMMMMMa
                                                          ZMMM. 0Z                                                                           :MMM7 7B
                                                         rMM@                                                                                MMM
         7                                               MMM                                                                                MMM.
       BMMMa XZ               :MM:                      MMM                                                                                XMMX
     XMSANMAYCE;             rMMMM                     rMM;                                                                                MM@
    WM0  2MMMMM             ZMMMM                      MMW                                                                                BMM
    :      MMMB           aMMMMW                      2MM                                                           :MM8                  MM7               8MMi
            MMMZ           XMMM                       MMa                                                         .WMMM0                 @MM              rMMMMi
            MMMMa           MM,                      aMM                                                          XMMB                   MM:              MMM2
           @MXMMM7         0MM                       MMS                                                                                WMM
           MM  MMM,        MM7                      7MM                                                                                 MM:
          MMX  ;MMM       iMM         MMM8  .       MM8     MMS         MMMZ  .     iMBi    :MMMX      @MMa      WB:       XMMZ2aX     ZMM     MMM2     :M2
         :MM    ZMMM      BM8       ;MMMMMaaMM     ,MM    XMM@MM      rMMMMM2aMM   XMMMM   SMMSMM.    MMXMMM    MMMM0     aMMMa@MMr    MMS   ;MM;MM8   XMMMM.
         MMr     MMM0     MM       2MMW    MMM     0MM   ZMS 2MM.    aMMB    MMM  BM aMM  8Ma  MM   iMM  BMM   M7 MMZ    ;MMX   MMi   ;MM   ZMW  MM0  rM 7MM
        ;MM       MMM7   iMM      ZMM2    0MMa     MMX  8M:  MMM    ZMMS    BMM2  7  MM8 ZMr  :MM  rMB   MM@     iMM     MMZ   iMM    WMW  BM2   MMX     @MM
        MMi       ;MMM   0MS     2MM7    aMMM     ;MM .8Mi  MMM    aMM7    ZMMM      MM ;Mr   XMM iM8    MMa     0MM    BMM    MMM    MM: BMX   .MM      MM7
       aMM         BMMM  MM     ;MMX    ZMMMZ     BM@ MMM    .    rMM7    ZMMMZ     :MM:MX    0MZ M8    XMM,     MMX    MM.    ;W:   rMM aMX    ZMM     7MM
       MM           MMMi MM     MMZ    8M:MM      MM; MMM,        MMa    0M:MM      8MWM8     MMZM0     MMM     rMM    0MM           WMa,M2     MMS     MM8
      @M0           :MMMXMa    MMM    WM XMB ;   :MM;M8MMM       MMM    @M XM0 ;    MMM@      MMMW      MMrZi   MMS    MMi           MMZM0     rMM Mi   MM :
     ;MM             BMMMM:   rMM    MM  MMSMa   ZMMM@ iMMr     7MM    MM  MMXM2   :MMM      ZMMM      8MM@@    MMZ0  7MM       ,   :MMMM      MMBMa   0MWBr
    ,MMMM             MMMM    MMS   MM   MMMZ    MMMM   MMM     MMS  .MM   MMMZ    @MM.      MMM       MMMM    WMM@   0MM      2M   ZMMM      :MMMa    MMM7
  iMMMMMM@            XMMM   .MM  XMM   aMMM     MMM:    MMW   .MM  XM@   ZMMM     MM0      aMMX      8MMM    .MMM    WMM     ZMr   MMMX      MMM8    0MMS
 SMMMMi                MMM,  rMM,MM2    MMM:    SMMM     ;MM2  ;MM,MMS    MMM,    MMM       MMM       MMM.    MMM     .MM    MMZ    MMM      XMMM    rMMB
 :MMM7                 MM@    BMMM      aMM     ;MMX      aMMX  8MMM      ZMM     MM8      .MMX      MMM2    iMMX      ,MMMMMMZ     .@;      MMM     WMM
    .                  .:                         :        0MMZ                                      .2Z                  :7r.                ;i
                                                            0MMMaSMi
                                                             aMMMM7
                                                              .WW

Nakamichi 'Kaidanji', written by Kaze, inspired by Haruhiko Okumura sharing, based on Nobuo Ito's LZSS source, muffinesque tips by m^2, Jim Dempsey and Kirill Kryukov enforced.
This latest (2021-Aug-04) compile has B-trees only matchfinder - called 'SUPRALITE'; Downloadable at: https://twitter.com/Sanmayce

Nakamichi 'Kaidanji' SUPRALITE highlights:

- Back to supersimplisticism - 'Kaidanji' returns refined. Simply, ripping only orders 4,6,8,10,12,14,16,18,36,64 and then quickly trying to expand the match in the found position.

Nakamichi 'Ryuugan-ditto-1TB'/'Dragoneye' LITE highlights:

- The Zennish LZSS Microdeduplicator, a texttoy (file-to-file [de]compressor) written in plain C, 100% FREE - licenseless it is;
- Single-threaded Non-SIMD console tool written entirely by yours truly Sanmayce;
- The first Lempel-Ziv-Storer-Szymanski (LZSS) compressor using 1TB sliding window;
- It targets superfast decompression of huge/tera corpora of textual data;

- LITE means no memmem() (Railgun) invocations are to be made, nah, back to minimalistic Railgun since 2021-Mar-12;
- Compressing at Linear Rate due to Matchfinding based on B-trees only;
- The Leprechaunesque (Internal/External) B-trees order 3 (2 keys MAX) are brutally-optimized;

- Ability to deduplicate (as little as) 64 bytes long chunks 1TB backwards;
- Ability to deduplicate 256[+] bytes long chunks 1TB backwards - when SHA3 enabled;

- CHUNKABLE! Since there are no headers/metadata in .Nakamichi files, arbitrary chunks/blocks can be compressed-n-concatenated;

- SCALABLE! Gets faster when more Physical or/and External RAM is available;
- Dynamical (as command line parameters) selection of HASH & B-trees memory blocks;
- AUTO-RESETTING PASSES (when TargetBuffer is filled then automaticaly restart building by doubling the passes);
- DEFRAGMENTED B-trees are in use during compression stage, their leaves contain only BBs appearing 2[+] times;

- Compileable under Windows and Linux, most suitable to run on 3TB machines;
- Many thanks go to: Haruhiko Okumura, Nobuo Ito, Hamid Buzidi, Landon Noll, J. Andrew Rogers, Aleksey Vaneev (https://github.com/avaneev/prvhash).

Sanmayce, Nakamichi's author, here, some more notes:

- The B-trees form the second layer, the first being HASH table handled by FNV1A-Pippip - the fastest lookup-hash;
- Hashpot a.k.a. hashpools (residing in Physical RAM) could be tuned via command line parameter, thus lessening the B-trees heights;
- The building of B-trees is done dynamically-n-automatically in PASSES, thus LOCALITY/LOCALIZATION leads to cache-friendliness, for example, instead of confusing/blinding
  the SSD controller with building 2^27 ~= 128M B-trees at a time, 'PASSES' revision lowers the "noise/mayhem" 128 times by processing e.g. (20bit) 1M B-trees at a time;

- For so long, the main goal was to throw it in battle, thus to forge one battle-ready *nix/windows tool with superb hash/search/decompress capabilities.
- Straight up, a wish of mine is to have the latest English Wikipedia XML dump decompressed by Nakamichi into physical RAM and then followed by Kazahana's superfast exact/wildcard/fuzzy etudes.
- Through the years, such a transparent decompressor (load booster) has been losing momentum and kinda became unnecessary, but not for me, when HDDs had 40MB/s sequential read speeds it was ...
  boosty, now with SSDs reading at 1700+MB/s, not so smacky, yet uploading (on 128GB machines, 20GB+72GB needed) the whole Wikipedia ~20GB (instead of 72GB) is better, sizewise.

- Currently, having 16 (4,6,8,10,12,14,16,18,36,64,24,28,48,56,128,256) MatchLens being hashed (plus 1 being phantomic/temporary), 29bit hashtable results in: (16+1)*8*(2^29) = (16+1)*8*(1<<29) =
  69632MB hashpot (the cluster of all hashpools), each slot houses a QWORD (being an offset/address of a B-tree root).
- In near future, wanna see a machine (256GB RAM) crunching the 77,265,813,300 bytes file with this command line (it requires 2x72GB + 68GB + 2930GB = 212GB physical RAM + 2.9TB SSD RAM):
  D:\>timer64 Nakamichi.exe enwiki-20200420-pages-articles.xml enwiki-20200420-pages-articles.xml.Nakamichi 29 3000000 e
- In not so far future, wanna see a machine (4096GB RAM) crunching the 72GB file with this command line (it requires 2x72GB + 272GB + 2930GB = 3.3TB physical RAM):
  D:\>timer64 Nakamichi.exe enwiki-20200420-pages-articles.xml enwiki-20200420-pages-articles.xml.Nakamichi 31 3000000 i

Q: - HOW TO BOOST [BUILDING/COMPRESSION] SPEED?
A: - Now, the name of the game is "RAM in spades", if we have a lot then speed is going to jump a lot. How?
- First, by increasing the hash-pool - 20 (number of bits) was used in 'Taishukan' resulting in 2^20 =~ 1M hash-slots a.k.a. B-trees' roots per keysize, naturally, the bigger the faster since B-trees will
  have less height and will be more - aiming to reach the ideal case - having only hash-slots with no actual B-trees! Back to 'Taishukan', the testfile is ~77MB, it suggests using 128M slots to lower
  height/branching of B-trees - 2^27 leads to using 27. Feartime, going from 20 to 27: 8*(15+1)*2^(20) = 134,217,793 bytes; with the speed-up hash needs 8*(15+1)*2^(27) = 17,179,869,184 bytes, yes 16GB.
- Second, by lowering passes in building the B-trees - the trick is to increase the number in compile-time parameter -DSpeedUpBuilding=32 - (didn't make it as an execute-time parameter, lazy).
  If we look at the 'Taishukan' console log it tells us that (Target-Buffer 106 MB) x 64 passes = 6784MB are needed for building the B-trees in ONE PASS ONLY, so compile with -DSpeedUpBuilding=6784 instead.

Enfun!

Current priority class is REALTIME_PRIORITY_CLASS.
This compile uses B-trees only, no memmem() invocations - it compresses worse but much faster.
Allocating Source-Buffer 953 MB ...
Allocating Target-Buffer 1,953 MB ...
Source-file-Hash(FNV1A_YoshimitsuTRIAD) = 0x4b2c,7bbc
Leprechaun: Memory pool for B-trees is 50,000 MB.
Leprechaun: In this revision 128MB 10-way hash is used which results in 10 x 16,777,216 internal B-Trees of order 3.
Leprechaun: Allocating HASH memory 1,476,395,073 bytes = 8*(10+1)*2^(24) ... OK
Leprechaun: Allocating memory for B-trees 50001 MB ... OK
Kanshiketsu: Allocating Speed-up Array Source-Buffer_Skip-Vector 1,000,000,000 Bytes ...
Leprechaun: Size of input file: 1,000,000,000

Leprechaun: Using (first 16 bytes of) DoubleDeuceAES for Matches 16+ long, in order to reduce memory footprint.
Leprechaun: Inserting keys/BBs of order 004 into B-trees, free RAM in B-tree pool is 00,050,000 MB; Pass #000,001 of 000,001 ... DONE; 00,000,545,878 DEFRAGMENTED B-trees have been rooted so far.
            554,956 TotalNonUnique (of length 004) keys have been inserted into DEFRAGMENTED B-trees.
Kanshiketsu: HowManyPositionsAreNonUnique (for current order) = 999,989,545
Leprechaun: Inserting keys/BBs of order 006 into B-trees, free RAM in B-tree pool is 00,049,973 MB; Pass #000,001 of 000,001 ... DONE; 00,005,325,322 DEFRAGMENTED B-trees have been rooted so far.
            5,624,061 TotalNonUnique (of length 006) keys have been inserted into DEFRAGMENTED B-trees.
Kanshiketsu: HowManyPositionsAreNonUnique (for current order) = 998,048,954
Leprechaun: Inserting keys/BBs of order 008 into B-trees, free RAM in B-tree pool is 00,049,719 MB; Pass #000,001 of 000,001 ... DONE; 00,017,461,825 DEFRAGMENTED B-trees have been rooted so far.
            21,601,285 TotalNonUnique (of length 008) keys have been inserted into DEFRAGMENTED B-trees.
Kanshiketsu: HowManyPositionsAreNonUnique (for current order) = 977,418,851
Leprechaun: Inserting keys/BBs of order 010 into B-trees, free RAM in B-tree pool is 00,048,780 MB; Pass #000,001 of 000,001 ...
Leprechaun: Failure! Increment 'Memory for B-trees'!
Automatically increasing number of passes in order to fit B-trees into Target Buffer.
Leprechaun: Inserting keys/BBs of order 010 into B-trees, free RAM in B-tree pool is 00,048,780 MB; Pass #000,001 of 000,002 ...
Leprechaun: Failure! Increment 'Memory for B-trees'!
Automatically increasing number of passes in order to fit B-trees into Target Buffer.
Leprechaun: Inserting keys/BBs of order 010 into B-trees, free RAM in B-tree pool is 00,047,073 MB; Pass #000,004 of 000,004 ... DONE; 00,033,371,054 DEFRAGMENTED B-trees have been rooted so far.
            49,713,349 TotalNonUnique (of length 010) keys have been inserted into DEFRAGMENTED B-trees.
Kanshiketsu: HowManyPositionsAreNonUnique (for current order) = 916,936,309
Leprechaun: Inserting keys/BBs of order 012 into B-trees, free RAM in B-tree pool is 00,046,504 MB; Pass #000,001 of 000,004 ...
Leprechaun: Failure! Increment 'Memory for B-trees'!
Automatically increasing number of passes in order to fit B-trees into Target Buffer.
Leprechaun: Inserting keys/BBs of order 012 into B-trees, free RAM in B-tree pool is 00,043,141 MB; Pass #000,008 of 000,008 ... DONE; 00,050,003,353 DEFRAGMENTED B-trees have been rooted so far.
            79,779,695 TotalNonUnique (of length 012) keys have been inserted into DEFRAGMENTED B-trees.
Kanshiketsu: HowManyPositionsAreNonUnique (for current order) = 806,482,005
Leprechaun: Inserting keys/BBs of order 014 into B-trees, free RAM in B-tree pool is 00,038,269 MB; Pass #000,008 of 000,008 ... DONE; 00,066,731,140 DEFRAGMENTED B-trees have been rooted so far.
            97,811,459 TotalNonUnique (of length 014) keys have been inserted into DEFRAGMENTED B-trees.
Kanshiketsu: HowManyPositionsAreNonUnique (for current order) = 654,005,843
Leprechaun: Inserting keys/BBs of order 016 into B-trees, free RAM in B-tree pool is 00,033,009 MB; Pass #000,008 of 000,008 ... DONE; 00,083,457,333 DEFRAGMENTED B-trees have been rooted so far.
            97,277,746 TotalNonUnique (of length 016) keys have been inserted into DEFRAGMENTED B-trees.
Kanshiketsu: HowManyPositionsAreNonUnique (for current order) = 487,371,478
Leprechaun: Inserting keys/BBs of order 018 into B-trees, free RAM in B-tree pool is 00,028,423 MB; Pass #000,008 of 000,008 ... DONE; 00,100,113,445 DEFRAGMENTED B-trees have been rooted so far.
            82,668,688 TotalNonUnique (of length 018) keys have been inserted into DEFRAGMENTED B-trees.
Kanshiketsu: HowManyPositionsAreNonUnique (for current order) = 337,827,627
Leprechaun: Inserting keys/BBs of order 036 into B-trees, free RAM in B-tree pool is 00,027,862 MB; Pass #000,001 of 000,008 ...
Leprechaun: Failure! Increment 'Memory for B-trees'!
Automatically increasing number of passes in order to fit B-trees into Target Buffer.
Leprechaun: Inserting keys/BBs of order 036 into B-trees, free RAM in B-tree pool is 00,027,419 MB; Pass #000,016 of 000,016 ... DONE; 00,106,399,781 DEFRAGMENTED B-trees have been rooted so far.
            7,878,309 TotalNonUnique (of length 036) keys have been inserted into DEFRAGMENTED B-trees.
Kanshiketsu: HowManyPositionsAreNonUnique (for current order) = 18,937,686
Leprechaun: Inserting keys/BBs of order 064 into B-trees, free RAM in B-tree pool is 00,027,074 MB; Pass #000,016 of 000,016 ... DONE; 00,111,014,846 DEFRAGMENTED B-trees have been rooted so far.
            5,399,298 TotalNonUnique (of length 064) keys have been inserted into DEFRAGMENTED B-trees.
Kanshiketsu: HowManyPositionsAreNonUnique (for current order) = 11,858,786

Histogram (rotate it 90 degrees clockwise) of Unique-Building-Blocks appearing 2[+] times (e.g. 'alfalfa-alfa' stream has 1 BB with length 4 appearing 3 times thus adding 1 to the count for {004]):
 5,399,298{064]
 7,878,309{036]
82,668,688{018]
97,277,746{016]
97,811,459{014]
79,779,695{012]
49,713,349{010]
21,601,285{008]
 5,624,061{006]
   554,956{004]

Leprechaun: Total Searches-n-Inserts Per Second: 5,374,004 SNIPS = 38,870,176,200 keys in 7,233 seconds
Leprechaun: RAM needed to house B-trees (relative to the file being ripped): 24N = 22,947MB
Leprechaun: RAM needed to build B-trees IN ONE PASS: (Target-Buffer = 1,953 MB) x 16 passes = 31,248MB
Note: In case of RAM in spades then may use compile option: -DSpeedUpBuilding=31248

Compressing 1,000,000,000 bytes ...
-; Each rotation means 64KB are encoded; Speed: 0,211,999 B/s; Done 100%; Compression Ratio: 3.09:1; Matches(16/24/48): 11,057,356/0/1,854; 128[+] long matches: 19,859; ETA: 0.00 hours
NumberOfFullLiterals (lower-the-better): 30616
RAM-to-RAM performance: 211999 B/s.
Compressed to 323,536,798 bytes.
Source-file-Hash(FNV1A_YoshimitsuTRIAD) = 0x4b2c,7bbc
Target-file-Hash(FNV1A_YoshimitsuTRIAD) = 0x1dc2,c986


Kernel  Time =   238.203 =    1%
User    Time = 11747.484 =   97%
Process Time = 11985.687 =   99%    Virtual  Memory =  55379 MB
Global  Time = 12005.444 =  100%    Physical Memory =  34773 MB

G:\Kanshiketsu_AES_sourcecode>Nakamichi_Vanilla_LITE_Kaidanji-Kanshiketsu_DD-128AES_ICC_64bit.exe "TERAPIG_TS100.txt.Nakamichi" 1>"TERAPIG_TS100.txt.NKMCH"

G:\Kanshiketsu_AES_sourcecode>sha1sum "TERAPIG_TS100.txt.NKMCH"
d32aa36818d08568294777f8a23cae52ff240d53  TERAPIG_TS100.txt.NKMCH

G:\Kanshiketsu_AES_sourcecode>dir "TERAPIG_TS100.txt.*"/os
 Volume in drive G is TERA-PIG_1TB
 Volume Serial Number is 4CAE-F7A5

 Directory of G:\Kanshiketsu_AES_sourcecode

08/05/2021  07:33       323,536,798 TERAPIG_TS100.txt.Nakamichi
08/05/2021  07:33     1,000,000,000 TERAPIG_TS100.txt.NKMCH
04/25/2021  20:55     1,000,000,000 TERAPIG_TS100.txt
               3 File(s)  2,323,536,798 bytes
               0 Dir(s)  50,261,250,048 bytes free

G:\Kanshiketsu_AES_sourcecode>
