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

27
LINES

< > BotCompany Repo | #1028498 // Benchmark LineComp

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

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

!7

// Typical results: Can do 80M characters with -Xmx12G
// ~8 us per character

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);
  }
}

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: #1028498
Snippet name: Benchmark LineComp
Eternal ID of this version: #1028498/19
Text MD5: d935a6e5cf8b1cc4de4bc12e5e51ef44
Transpilation MD5: a3ccf751ff8039d3c46d7d0a0f1686f1
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-23 14:43:54
Source code size: 809 bytes / 27 lines
Pitched / IR pitched: No / No
Views / Downloads: 398 / 1422
Version history: 18 change(s)
Referenced in: [show references]