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

!include once #1030256 // Wikify

sclass TestWikify {
  S text;
  S pattern = "bla";
  new Wikify wikify;
  int n = oneMillion(), rep = 100;
  
  swappable S makeText() {
    ret rep('a', n) + " bla " + rep('b', n);
  }
  
  run {
    if (text == null) text = makeText();
    repeat 100 {
      //PreciselyTimed<Int> i = returnPreciselyTimed_repeat(rep, () -> wikify.anyIndexOf(text, pattern));
      int i = benchFor1Second(() -> wikify.anyIndexOf(text, pattern));
      print(wikify.slowSearches + " | " + i);
      //sleep(1000);
    }
    long size = l_long(wikify.indexed.searcher.getMem());
    print("Wikify size: " + str_toK(size) + ", ratio: " + doublePercentRatio(l(text), size) + "%");
  }
}

Author comment

Began life as a copy of #1030257

download  show line numbers  debug dex   

Travelled to 3 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx

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: 24 / 68
Version history: 8 change(s)
Referenced in: [show references]

Formerly at http://tinybrain.de/1030258 & http://1030258.tinybrain.de