Script Preparation code:
x
 
var test = `[{ "Text": ["","TEST FEBRUARY BRAND",""], "FontSize": "0", "IsBold":"False", "IsItalic":"False", "IsUnderline":"False", "IsJustified":"False" },
{ "Text": ["","35-010 Rzeszow",""], "FontSize": "0", "IsBold":"False", "IsItalic":"False", "IsUnderline":"False", "IsJustified":"False" },
{ "Text": ["","Tel 17-666-555-44",""], "FontSize": "0", "IsBold":"False", "IsItalic":"False", "IsUnderline":"False", "IsJustified":"False" },
{ "Text": ["","www.somepage.se",""], "FontSize": "0", "IsBold":"False", "IsItalic":"False", "IsUnderline":"False", "IsJustified":"False" },
{ "Text": ["","Org Nr: 12344321",""], "FontSize": "0", "IsBold":"False", "IsItalic":"False", "IsUnderline":"False", "IsJustified":"False" },
{ "Text": ["{SEPARATOR:-}","",""], "FontSize": "0", "IsBold":"False", "IsItalic":"False", "IsUnderline":"False", "IsJustified":"False" },
{ "Text": ["Datum: 2020-09-02 10:27:21","",""], "FontSize": "0", "IsBold":"False", "IsItalic":"False", "IsUnderline":"False", "IsJustified":"False" },
{ "Text": ["{SEPARATOR:-}","",""], "FontSize": "0", "IsBold":"False", "IsItalic":"False", "IsUnderline":"False", "IsJustified":"False" },
{ "Text": ["","",""], "FontSize": "0", "IsBold":"False", "IsItalic":"False", "IsUnderline":"False", "IsJustified":"False" },
{ "Text": [" ATT BETALA","","10.00"], "FontSize": "3", "IsBold":"True", "IsItalic":"False", "IsUnderline":"False", "IsJustified":"False" },
{ "Text": ["","",""], "FontSize": "0", "IsBold":"False", "IsItalic":"False", "IsUnderline":"False", "IsJustified":"False" },
{ "Text": [" KORT","","10.00"], "FontSize": "0", "IsBold":"False", "IsItalic":"False", "IsUnderline":"False", "IsJustified":"False" },
{ "Text": ["","",""], "FontSize": "0", "IsBold":"False", "IsItalic":"False", "IsUnderline":"False", "IsJustified":"False" },
{ "Text": ["{SEPARATOR:-}","",""], "FontSize": "0", "IsBold":"False", "IsItalic":"False", "IsUnderline":"False", "IsJustified":"False" },
{ "Text": ["","Godkännes för debitering",""], "FontSize": "0", "IsBold":"False", "IsItalic":"False", "IsUnderline":"False", "IsJustified":"False" },
{ "Text": ["","av mitt konto enligt",""], "FontSize": "0", "IsBold":"False", "IsItalic":"False", "IsUnderline":"False", "IsJustified":"False" },
{ "Text": ["","ovan",""], "FontSize": "0", "IsBold":"False", "IsItalic":"False", "IsUnderline":"False", "IsJustified":"False" },
{ "Text": ["","",""], "FontSize": "0", "IsBold":"False", "IsItalic":"False", "IsUnderline":"False", "IsJustified":"False" },
{ "Text": ["{SEPARATOR:.}","",""], "FontSize": "0", "IsBold":"False", "IsItalic":"False", "IsUnderline":"False", "IsJustified":"False" },
{ "Text": ["","Namn",""], "FontSize": "0", "IsBold":"False", "IsItalic":"False", "IsUnderline":"False", "IsJustified":"False" },
{ "Text": ["","",""], "FontSize": "0", "IsBold":"False", "IsItalic":"False", "IsUnderline":"False", "IsJustified":"False" },
{ "Text": ["","",""], "FontSize": "0", "IsBold":"False", "IsItalic":"False", "IsUnderline":"False", "IsJustified":"False" },
{ "Text": ["{SEPARATOR:.}","",""], "FontSize": "0", "IsBold":"False", "IsItalic":"False", "IsUnderline":"False", "IsJustified":"False" },
{ "Text": ["","Legitimation",""], "FontSize": "0", "IsBold":"False", "IsItalic":"False", "IsUnderline":"False", "IsJustified":"False" },
{ "Text": ["","",""], "FontSize": "0", "IsBold":"False", "IsItalic":"False", "IsUnderline":"False", "IsJustified":"False" },
{ "Text": ["","",""], "FontSize": "0", "IsBold":"False", "IsItalic":"False", "IsUnderline":"False", "IsJustified":"False" },
{ "Text": ["{CHANGE_MARGINS}","",""], "FontSize": "0", "IsBold":"False", "IsItalic":"False", "IsUnderline":"False", "IsJustified":"False" },
{ "Text": ["Totalt: ","","10,00 kr"], "FontSize": "0", "IsBold":"False", "IsItalic":"False", "IsUnderline":"False", "IsJustified":"False" },
{ "Text": ["PAN: **** **** **** 0119","","Payworks VISA"], "FontSize": "0", "IsBold":"False", "IsItalic":"False", "IsUnderline":"False", "IsJustified":"False" },
{ "Text": ["AID: A0000000031010","","Betalning"], "FontSize": "0", "IsBold":"False", "IsItalic":"False", "IsUnderline":"False", "IsJustified":"False" },
{ "Text": ["2020-09-02 10:27:14","","Kontaktlös"], "FontSize": "0", "IsBold":"False", "IsItalic":"False", "IsUnderline":"False", "IsJustified":"False" },
{ "Text": ["Transaktion: CI_ET6","",""], "FontSize": "0", "IsBold":"False", "IsItalic":"False", "IsUnderline":"False", "IsJustified":"False" },
{ "Text": ["Auktorisation: AI_TXM/II_vYz","",""], "FontSize": "0", "IsBold":"False", "IsItalic":"False", "IsUnderline":"False", "IsJustified":"False" },
{ "Text": ["Butik: cb90342a-589b-4f6e-a3fd-5013cffb5441","",""], "FontSize": "0", "IsBold":"False", "IsItalic":"False", "IsUnderline":"False", "IsJustified":"False" },
{ "Text": ["TermId: BAD62854","",""], "FontSize": "0", "IsBold":"False", "IsItalic":"False", "IsUnderline":"False", "IsJustified":"False" },
{ "Text": ["APPROVED","",""], "FontSize": "0", "IsBold":"False", "IsItalic":"False", "IsUnderline":"False", "IsJustified":"False" },
{ "Text": ["{CHANGE_MARGINS}","",""], "FontSize": "0", "IsBold":"False", "IsItalic":"False", "IsUnderline":"False", "IsJustified":"False" },
{ "Text": ["","Välkommen åter!",""], "FontSize": "0", "IsBold":"False", "IsItalic":"False", "IsUnderline":"False", "IsJustified":"False" },
]
NEXT_TEXT_SEPARATOR
[{ "Text": ["","TEST FEBRUARY BRAND",""], "FontSize": "0", "IsBold":"False", "IsItalic":"False", "IsUnderline":"False", "IsJustified":"False" },
{ "Text": ["","35-010 Rzeszow",""], "FontSize": "0", "IsBold":"False", "IsItalic":"False", "IsUnderline":"False", "IsJustified":"False" },
{ "Text": ["","Tel 17-666-555-44",""], "FontSize": "0", "IsBold":"False", "IsItalic":"False", "IsUnderline":"False", "IsJustified":"False" },
{ "Text": ["","www.somepage.se",""], "FontSize": "0", "IsBold":"False", "IsItalic":"False", "IsUnderline":"False", "IsJustified":"False" },
{ "Text": ["","Org Nr: 12344321",""], "FontSize": "0", "IsBold":"False", "IsItalic":"False", "IsUnderline":"False", "IsJustified":"False" },
{ "Text": ["{SEPARATOR:-}","",""], "FontSize": "0", "IsBold":"False", "IsItalic":"False", "IsUnderline":"False", "IsJustified":"False" },
{ "Text": ["Datum: 2020-09-02 10:27:21","",""], "FontSize": "0", "IsBold":"False", "IsItalic":"False", "IsUnderline":"False", "IsJustified":"False" },
{ "Text": ["{SEPARATOR:-}","",""], "FontSize": "0", "IsBold":"False", "IsItalic":"False", "IsUnderline":"False", "IsJustified":"False" },
{ "Text": ["","",""], "FontSize": "0", "IsBold":"False", "IsItalic":"False", "IsUnderline":"False", "IsJustified":"False" },
{ "Text": [" ATT BETALA","","10.00"], "FontSize": "3", "IsBold":"True", "IsItalic":"False", "IsUnderline":"False", "IsJustified":"False" },
{ "Text": ["","",""], "FontSize": "0", "IsBold":"False", "IsItalic":"False", "IsUnderline":"False", "IsJustified":"False" },
{ "Text": [" KORT","","10.00"], "FontSize": "0", "IsBold":"False", "IsItalic":"False", "IsUnderline":"False", "IsJustified":"False" },
{ "Text": ["","",""], "FontSize": "0", "IsBold":"False", "IsItalic":"False", "IsUnderline":"False", "IsJustified":"False" },
{ "Text": ["{SEPARATOR:-}","",""], "FontSize": "0", "IsBold":"False", "IsItalic":"False", "IsUnderline":"False", "IsJustified":"False" },
{ "Text": ["{CHANGE_MARGINS}","",""], "FontSize": "0", "IsBold":"False", "IsItalic":"False", "IsUnderline":"False", "IsJustified":"False" },
{ "Text": ["Totalt: ","","10,00 kr"], "FontSize": "0", "IsBold":"False", "IsItalic":"False", "IsUnderline":"False", "IsJustified":"False" },
{ "Text": ["PAN: **** **** **** 0119","","Payworks VISA"], "FontSize": "0", "IsBold":"False", "IsItalic":"False", "IsUnderline":"False", "IsJustified":"False" },
{ "Text": ["AID: A0000000031010","","Betalning"], "FontSize": "0", "IsBold":"False", "IsItalic":"False", "IsUnderline":"False", "IsJustified":"False" },
{ "Text": ["2020-09-02 10:27:14","","Kontaktlös"], "FontSize": "0", "IsBold":"False", "IsItalic":"False", "IsUnderline":"False", "IsJustified":"False" },
{ "Text": ["Transaktion: CI_ET6","",""], "FontSize": "0", "IsBold":"False", "IsItalic":"False", "IsUnderline":"False", "IsJustified":"False" },
{ "Text": ["Auktorisation: AI_TXM/II_vYz","",""], "FontSize": "0", "IsBold":"False", "IsItalic":"False", "IsUnderline":"False", "IsJustified":"False" },
{ "Text": ["Butik: cb90342a-589b-4f6e-a3fd-5013cffb5441","",""], "FontSize": "0", "IsBold":"False", "IsItalic":"False", "IsUnderline":"False", "IsJustified":"False" },
{ "Text": ["TermId: BAD62854","",""], "FontSize": "0", "IsBold":"False", "IsItalic":"False", "IsUnderline":"False", "IsJustified":"False" },
{ "Text": ["APPROVED","",""], "FontSize": "0", "IsBold":"False", "IsItalic":"False", "IsUnderline":"False", "IsJustified":"False" },
{ "Text": ["{CHANGE_MARGINS}","",""], "FontSize": "0", "IsBold":"False", "IsItalic":"False", "IsUnderline":"False", "IsJustified":"False" },
{ "Text": ["","Välkommen åter!",""], "FontSize": "0", "IsBold":"False", "IsItalic":"False", "IsUnderline":"False", "IsJustified":"False" },
]`
Tests:
  • slice

     
    var result = test.slice(test.search('NEXT_TEXT_SEPARATOR'))
  • substr

     
    var result = test.substr(test.search('NEXT_TEXT_SEPARATOR'))
  • substring

     
    var result = test.substring(test.search('NEXT_TEXT_SEPARATOR'))
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    slice
    substr
    substring

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 4 years ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:80.0) Gecko/20100101 Firefox/80.0
Firefox 80 on Windows
View result in a separate tab
Test name Executions per second
slice 1077207.9 Ops/sec
substr 1085065.4 Ops/sec
substring 1129446.6 Ops/sec