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).

1  
!7
2  
3  
!include #1007737 // leven_limited (unfixed)
4  
5  
static int n = 1000000;
6  
sS a = repeat('a', n) + repeat('b', n);
7  
sS b = repeat('a', n+10) + repeat('b', n-10);
8  
9  
p {
10  
  for (int max = 0; max <= 20; max++)
11  
    test(max);
12  
  test(100);
13  
  test(1000);
14  
  test(10000);
15  
  test(100000);
16  
  test(1000000);
17  
  test(10000000);
18  
  test(100000000);
19  
}
20  
21  
svoid test(int max) {
22  
  long startTime = sysNow();
23  
  System.out.println("max " + max + " => " + leven_limited(a, b, max));
24  
  System.out.println((sysNow()-startTime) + " ms");
25  
}

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: 395 / 501
Version history: 15 change(s)
Referenced in: [show references]