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

20
LINES

< > BotCompany Repo | #1010029 - Benchmark loading small text file [gives .04 ms and .004 ms for me]

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

Libraryless. Click here for Pure Java version (1540L/10K).

!7

static int n = 100000;

p {
  File there = saveTextFile(prepareProgramFile("there.txt"), "hello");
  File notThere = prepareProgramFile("notthere.txt");
  
  print("n = " + n);
  
  time "there" {
    repeat n { loadTextFile(there); }
  }
  printTimingDividedBy(n);
  
  time "not there" {
    repeat n { loadTextFile(notThere); }
  }
  printTimingDividedBy(n);
}

download  show line numbers  debug dex   

Travelled to 11 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz

No comments. add comment

Snippet ID: #1010029
Snippet name: Benchmark loading small text file [gives .04 ms and .004 ms for me]
Eternal ID of this version: #1010029/3
Text MD5: f3e3bd29f0528c2027dbe22eabff9da8
Transpilation MD5: 9a00cf66a9b89b528a4e7f0e35685fcc
Author: stefan
Category: javax
Type: JavaX source code (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-08-29 16:52:04
Source code size: 386 bytes / 20 lines
Pitched / IR pitched: No / No
Views / Downloads: 243 / 281
Version history: 2 change(s)
Referenced in: [show references]

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