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

25
LINES

< > BotCompany Repo | #1007598 // Test speed of leven_limited [demonstrates VM safepointing problem]

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

Libraryless. Click here for Pure Java version (158L/2K/4K).

!7

!include #1007737 // leven_limited (unfixed)

static int n = 1000000;
sS a = repeat('a', n) + repeat('b', n);
sS b = repeat('a', n+10) + repeat('b', n-10);

p {
  for (int max = 0; max <= 20; max++)
    test(max);
  test(100);
  test(1000);
  test(10000);
  test(100000);
  test(1000000);
  test(10000000);
  test(100000000);
}

svoid test(int max) {
  long startTime = sysNow();
  System.out.println("max " + max + " => " + leven_limited(a, b, max));
  System.out.println((sysNow()-startTime) + " ms");
}

download  show line numbers  debug dex  old transpilations   

Travelled to 15 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt, wtqryiryparv

No comments. add comment

Snippet ID: #1007598
Snippet name: Test speed of leven_limited [demonstrates VM safepointing problem]
Eternal ID of this version: #1007598/16
Text MD5: 0cb83f1fcae6bd8979b2fdb22201ab1f
Transpilation MD5: 5b055563b5fa1d3560a0b8f362f13b64
Author: stefan
Category: javax / text
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-09-23 14:03:00
Source code size: 535 bytes / 25 lines
Pitched / IR pitched: No / No
Views / Downloads: 463 / 595
Version history: 15 change(s)
Referenced in: #1007601 - VM Weakener
#1007735 - Fixed "VM Breaker"