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

21
LINES

< > BotCompany Repo | #1017783 // Bench match3() - now does 4M+ matches per second with big enough cache

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

Download Jar. Libraryless. Click here for Pure Java version (7405L/53K).

!7

p-exp {
  int n = 200000, count = 0;
  LS l = mL("Random facts");
  S s = "I am a *";
  parse3_cachedInput_cache = synchronizedMRUCache(100);
  
  twice { time {
    count = 0;
    repeat n {
      for (S x : l) if (match3(s, x)) ++count;
    }
  }}
  printBenchResult(n*l(l));
  print(count);
  
  for (S v : allCacheVars()) pcall-short {
    print(v + ": " + l(getMC(v)));
  }
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1017783
Snippet name: Bench match3() - now does 4M+ matches per second with big enough cache
Eternal ID of this version: #1017783/11
Text MD5: 793fef6ff4a9fe12233e59c058c4c24a
Transpilation MD5: 8f9e0146977691a1bdb96a494a98c7a4
Author: stefan
Category: javax / a.i.
Type: JavaX source code (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-08-11 14:09:07
Source code size: 404 bytes / 21 lines
Pitched / IR pitched: No / No
Views / Downloads: 419 / 938
Version history: 10 change(s)
Referenced in: [show references]