Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

30
LINES

< > BotCompany Repo | #1028520 // Benchmark LineComp v2 [OK, compact and fast!]

JavaX source code (desktop) [tags: use-pretranspiled] - run with: x30.jar

Download Jar. Uses 11335K of libraries. Click here for Pure Java version (8621L/57K).

!7

// Typical results: Would be able to do 100M characters with -Xmx12G if it wasn't for the final decoding step...
// So 95M should probably work.
// ~5-7 us per character

!include once #1028521 // LineComp_PairIndex, new version

set flag LineComp_SingleChain.

p {
  noRegularGC();
  twice { print(); go(args); }
}

svoid go(S[] args) {
  int n = parseIntOr(first(args), 1);
  int max = parseIntOr(second(args), 100*oneMillion());
  for (; n <= max; n += (n >= tenMillion() ? tenMillion() : n)) {
    consoleStatus("n=" + n);
    Random random = repeatableRandomizer();
    S input = stringFromRepF(() -> charPlus('a', randomInt(random, 3)), n);
    long time = sysNow();
    new LineCompCompressor compressor;
    compressor.verboseStats = true;
    LineCompedSingle<Char> lc = lineComp_compressTextAsChars(compressor, input);
    time = sysNow()-time;
    printBenchResult("complexity: " + lcRoughComplexity(lc), time, n);
  }
}

Author comment

Began life as a copy of #1028498

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1028520
Snippet name: Benchmark LineComp v2 [OK, compact and fast!]
Eternal ID of this version: #1028520/8
Text MD5: cbccaed1f864753405ff947f4de21951
Transpilation MD5: 1095e1249709ec2ce2b3dd590f31eca2
Author: stefan
Category: javax / linecomp compression
Type: JavaX source code (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-06-24 03:17:34
Source code size: 964 bytes / 30 lines
Pitched / IR pitched: No / No
Views / Downloads: 347 / 1089
Version history: 7 change(s)
Referenced in: [show references]