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

22
LINES

< > BotCompany Repo | #1005594 // Benchmark quote()

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

Libraryless. Click here for Pure Java version (638L/5K/15K).

1  
!752
2  
3  
static final long rep = 1000000;
4  
5  
!include #1005595 // new quote()
6  
7  
p {
8  
  // check sanity
9  
  assertEquals([["abc"]], quote("abc"));
10  
  assertEquals([["a\"b"]], quote("a\"b"));
11  
  assertEquals([["a\\b"]], quote("a\\b"));
12  
  assertEquals([["a\rb"]], quote("a\rb"));
13  
  assertEquals([["a\n\rb"]], quote("a\n\rb"));
14  
  
15  
  twice {
16  
    time {
17  
      for (long j = 0; j < rep; j++)
18  
        quote("abc");
19  
    }
20  
    print(iterationsPerSecond(rep) + " quotes/s");
21  
  }
22  
}

Author comment

Began life as a copy of #1005586

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1005594
Snippet name: Benchmark quote()
Eternal ID of this version: #1005594/1
Text MD5: 92663172da2d917f6e7ecc0362bb6bb5
Transpilation MD5: 402efb8cb398944f5aff893c90ac5860
Author: stefan
Category: javax
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-11-28 20:46:18
Source code size: 479 bytes / 22 lines
Pitched / IR pitched: No / No
Views / Downloads: 628 / 733
Referenced in: [show references]