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

24
LINES

< > BotCompany Repo | #1030258 // TestWikify

JavaX fragment (include) [tags: use-pretranspiled]

Uses 11335K of libraries. Click here for Pure Java version (14787L/101K).

1  
!include once #1030256 // Wikify
2  
3  
sclass TestWikify {
4  
  S text;
5  
  S pattern = "bla";
6  
  new Wikify wikify;
7  
  int n = oneMillion(), rep = 100;
8  
  
9  
  swappable S makeText() {
10  
    ret rep('a', n) + " bla " + rep('b', n);
11  
  }
12  
  
13  
  run {
14  
    if (text == null) text = makeText();
15  
    repeat 100 {
16  
      //PreciselyTimed<Int> i = returnPreciselyTimed_repeat(rep, () -> wikify.anyIndexOf(text, pattern));
17  
      int i = benchFor1Second(() -> wikify.anyIndexOf(text, pattern));
18  
      print(wikify.slowSearches + " | " + i);
19  
      //sleep(1000);
20  
    }
21  
    long size = l_long(wikify.indexed.searcher.getMem());
22  
    print("Wikify size: " + str_toK(size) + ", ratio: " + doublePercentRatio(l(text), size) + "%");
23  
  }
24  
}

Author comment

Began life as a copy of #1030257

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt

No comments. add comment

Snippet ID: #1030258
Snippet name: TestWikify
Eternal ID of this version: #1030258/9
Text MD5: 73e2978ee50e30a3588eb66ddbb05f98
Transpilation MD5: f44505692195d6ce25695c78d6c91b10
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-11-21 11:49:48
Source code size: 725 bytes / 24 lines
Pitched / IR pitched: No / No
Views / Downloads: 162 / 394
Version history: 8 change(s)
Referenced in: [show references]