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

20
LINES

< > BotCompany Repo | #1024022 - Test countConcepts optimization (OK)

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

Libraryless. Click here for Pure Java version (12081L/82K).

!7

concept A { S x; }
concept B { S y; }

static int i = 100000, j = 100005;
  
p {
  repeat i { new A; }
  repeat j { new B; }
  
  // speed up counting
  print("indexing"); indexConceptField(A, 'x);
  print("indexing"); indexConceptFieldCI(B, 'y);
  
  time "check" {
    repeat 100 { print("counting"); assertEqualsVerbose(i, countConcepts(A)); }
    repeat 100 { assertEqualsVerbose(j, countConcepts(B)); }
  }
}

download  show line numbers  debug dex   

Travelled to 2 computer(s): mqqgnosmbjvj, tvejysmllsmz

No comments. add comment

Snippet ID: #1024022
Snippet name: Test countConcepts optimization (OK)
Eternal ID of this version: #1024022/16
Text MD5: a3b14bd2253399a61ffcf70ac4ee7bbd
Transpilation MD5: 7887a4860544528121057b27e0e4da1b
Author: stefan
Category: javax / concepts
Type: JavaX source code (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-07-16 22:41:50
Source code size: 436 bytes / 20 lines
Pitched / IR pitched: No / No
Views / Downloads: 63 / 184
Version history: 15 change(s)
Referenced in: [show references]

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