From bbcdc8dcff96b9e95b6f500e2fb149b1d0578bc2 Mon Sep 17 00:00:00 2001 From: Aske Simon Christensen Date: Wed, 1 Jul 2020 16:53:11 +0000 Subject: [PATCH] [benchmarks] Migrate Utf8Decode benchmark. Change-Id: Idc5288c3df2e12e2a9d29c3102549531d46e4ff4 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153081 Reviewed-by: Jonas Termansen Commit-Queue: Aske Simon Christensen --- benchmarks/Utf8Decode/dart/Utf8Decode.dart | 43 ++++++++++--------- .../Utf8Decode/dart/datext_latin1_10k.dart | 4 +- .../Utf8Decode/dart/entext_ascii_10k.dart | 4 +- benchmarks/Utf8Decode/dart/netext_3_10k.dart | 4 +- benchmarks/Utf8Decode/dart/rutext_2_10k.dart | 4 +- benchmarks/Utf8Decode/dart/sktext_10k.dart | 4 +- benchmarks/Utf8Decode/dart/zhtext_10k.dart | 4 +- benchmarks/Utf8Decode/dart2/Utf8Decode.dart | 34 ++++++++------- .../Utf8Decode/dart2/datext_latin1_10k.dart | 4 +- .../Utf8Decode/dart2/entext_ascii_10k.dart | 4 +- benchmarks/Utf8Decode/dart2/netext_3_10k.dart | 4 +- benchmarks/Utf8Decode/dart2/rutext_2_10k.dart | 4 +- benchmarks/Utf8Decode/dart2/sktext_10k.dart | 4 +- benchmarks/Utf8Decode/dart2/zhtext_10k.dart | 4 +- 14 files changed, 64 insertions(+), 61 deletions(-) diff --git a/benchmarks/Utf8Decode/dart/Utf8Decode.dart b/benchmarks/Utf8Decode/dart/Utf8Decode.dart index a1b423dc048..504debe2368 100644 --- a/benchmarks/Utf8Decode/dart/Utf8Decode.dart +++ b/benchmarks/Utf8Decode/dart/Utf8Decode.dart @@ -21,16 +21,16 @@ class Utf8Decode extends BenchmarkBase { final String text; final int size; final bool allowMalformed; - List chunks; - int totalInputSize; - int totalOutputSize; + late List chunks; + int totalInputSize = 0; + int totalOutputSize = 0; static String _makeName(String language, int size, bool allowMalformed) { - String name = "Utf8Decode.$language."; + String name = 'Utf8Decode.$language.'; name += size >= 1000000 - ? "${size ~/ 1000000}M" - : size >= 1000 ? "${size ~/ 1000}k" : "$size"; - if (allowMalformed) name += ".malformed"; + ? '${size ~/ 1000000}M' + : size >= 1000 ? '${size ~/ 1000}k' : '$size'; + if (allowMalformed) name += '.malformed'; return name; } @@ -39,9 +39,9 @@ class Utf8Decode extends BenchmarkBase { @override void setup() { - Uint8List data = utf8.encode(text) as Uint8List; + final Uint8List data = utf8.encode(text) as Uint8List; if (data.length != 10000) { - throw "Expected input data of exactly 10000 bytes."; + throw 'Expected input data of exactly 10000 bytes.'; } if (size < data.length) { // Split into chunks. @@ -83,7 +83,7 @@ class Utf8Decode extends BenchmarkBase { lengthSum += s.length; } if (lengthSum != totalOutputSize) { - throw "Output length doesn't match expected."; + throw 'Output length doesn\'t match expected.'; } } @@ -108,28 +108,29 @@ class Utf8Decode extends BenchmarkBase { void report() { // Report time in nanoseconds. final double score = measure() * 1000.0; - print("$name(RunTime): $score ns."); + print('$name(RunTime): $score ns.'); } } void main(List args) { const texts = { - "en": en, - "da": da, - "sk": sk, - "ru": ru, - "ne": ne, - "zh": zh, + 'en': en, + 'da': da, + 'sk': sk, + 'ru': ru, + 'ne': ne, + 'zh': zh, }; - final bool testMalformed = - args != null && args.isNotEmpty && args.first == "malformed"; + final bool testMalformed = args.isNotEmpty && args.first == 'malformed'; final benchmarks = [ // Only benchmark with allowMalformed: false unless specified otherwise. for (bool allowMalformed in [false, if (testMalformed) true]) for (int size in [10, 10000, 10000000]) for (String language in texts.keys) - () => Utf8Decode(language, texts[language], size, allowMalformed) + () => Utf8Decode(language, texts[language]!, size, allowMalformed) ]; - benchmarks.forEach((bm) => bm().report()); + for (var bm in benchmarks) { + bm().report(); + } } diff --git a/benchmarks/Utf8Decode/dart/datext_latin1_10k.dart b/benchmarks/Utf8Decode/dart/datext_latin1_10k.dart index 866ff83cec8..bce6c80589b 100644 --- a/benchmarks/Utf8Decode/dart/datext_latin1_10k.dart +++ b/benchmarks/Utf8Decode/dart/datext_latin1_10k.dart @@ -7,7 +7,7 @@ // The material is licensed under the Creative Commons Attribution-Share-Alike // License 3.0: https://creativecommons.org/licenses/by-sa/3.0/ -const String da = """ +const String da = ''' Anders And Anders Fauntleroy And er en berømt figur i Disneys tegnefilm og tegneserier. Selv om han ikke er særligt populær i USA, optræder han i mange ugeblade i Europa: I Norge, Tyskland, Sverige, Danmark, Holland, Italien med flere. Hans første optræden var i tegnefilmen "The Wise Little Hen" (Den kloge lille høne) fra 9. juni 1934. Hans karakteristiske stemme blev indtalt af radiokomikeren Clarence Nash, der siden fast lagde stemme til. @@ -59,4 +59,4 @@ En mængde temaer var ofte i centrum for historierne, bl.a. tidsrejser og Tidspo Serien fik en fornyelse i 2001, hvilket ændrede markant på historierne. Everett Ducklair vender tilbage, slukker Globus, smider Stålanden ud af Ducklair Tower og genopretter sit gamle imperium. Undervejs bliver Ducklair's to døtre afsløret. De hader begge Everett af grunde, der ikke bliver afsløret til fulde, selvom det bliver antydet, at Everett skilte sig af med deres mor på en eller anden måde. Denne fornyelse holdt 18 numre, før serien blev afsluttet, dog uden at historierne fik en slutning. -Barks-historien "Anders And og den gyldne hjelm" fra 1954 kom i 2006 med i """; +Barks-historien "Anders And og den gyldne hjelm" fra 1954 kom i 2006 med i '''; diff --git a/benchmarks/Utf8Decode/dart/entext_ascii_10k.dart b/benchmarks/Utf8Decode/dart/entext_ascii_10k.dart index 9353d6dd56f..82cb7218946 100644 --- a/benchmarks/Utf8Decode/dart/entext_ascii_10k.dart +++ b/benchmarks/Utf8Decode/dart/entext_ascii_10k.dart @@ -7,7 +7,7 @@ // The material is licensed under the Creative Commons Attribution-Share-Alike // License 3.0: https://creativecommons.org/licenses/by-sa/3.0/ -const String en = """ +const String en = ''' Anarchism Anarchism is a radical political movement that is highly skeptical towards authority and rejects all forms of unjust hierarchy. It calls for the abolition of the state which it holds to be undesirable, unnecessary, and harmful. Anarchism advocates for the replacement of the state with stateless societies or other forms of free associations. @@ -32,4 +32,4 @@ Drawing from mutualism, Mikhail Bakunin founded collectivist anarchism and enter At the turning of the century, anarchism had spread all over the world. In China, small groups of students imported the humanistic pro-science version of anarcho-communism. Tokyo was a hotspot for rebellious youth from countries of the far east, pouring into the Japanese capital to study. In Latin America, So Paulo was a stronghold for anarcho-syndicalism where it became the most prominent left-wing ideology. During this time, a minority of anarchists adopted tactics of revolutionary political violence. This strategy became known as propaganda of the deed. The dismemberment of the French socialist movement into many groups and the execution and exile of many Communards to penal colonies following the suppression of the Paris Commune favoured individualist political expression and acts. Even though many anarchists distanced themselves from these terrorist acts, infamy came upon the movement. Illegalism was another strategy which some anarchists adopted these same years. Anarchists enthusiastically participated in the Russian Revolutiondespite concernsin opposition to the Whites. However, they met harsh suppression after the Bolshevik government was stabilized. Several anarchists from Petrograd and Moscow fled to Ukraine, notably leading to the Kronstadt rebellion and Nestor Makhno's struggle in the Free Territory. With the anarchists being crushed in Russia, two new antithetical currents emerged, namely platformism and synthesis anarchism. The former sought to create a coherent group that would push for the revolution while the latter were against anything that would resemble a political party. Seeing the victories of the Bolsheviks in the October Revolution and the resulting Russian Civil War, many workers and activists turned to communist parties which grew at the expense of anarchism and other socialist movements. In France and the United States, members of major syndicalist movements, the General Confederation of Labour and Industrial Workers of the World, left their organisations and joined the Communist International. -In the Spanish Civil War, anarchists and syndicalists (CNT and FAI) once again allied themselves with various currents of leftists. A long tradition of Spanish anarchism led to anarchists playing a pivotal role in the war. In response to the army rebellion, an anarchist-inspired movement of peasants and workers, supported by armed militias, took control of Barcelona and of large areas of rural Spain where they collectivised """; +In the Spanish Civil War, anarchists and syndicalists (CNT and FAI) once again allied themselves with various currents of leftists. A long tradition of Spanish anarchism led to anarchists playing a pivotal role in the war. In response to the army rebellion, an anarchist-inspired movement of peasants and workers, supported by armed militias, took control of Barcelona and of large areas of rural Spain where they collectivised '''; diff --git a/benchmarks/Utf8Decode/dart/netext_3_10k.dart b/benchmarks/Utf8Decode/dart/netext_3_10k.dart index be53bc3f142..8fce5509349 100644 --- a/benchmarks/Utf8Decode/dart/netext_3_10k.dart +++ b/benchmarks/Utf8Decode/dart/netext_3_10k.dart @@ -7,7 +7,7 @@ // The material is licensed under the Creative Commons Attribution-Share-Alike // License 3.0: https://creativecommons.org/licenses/by-sa/3.0/ -const String ne = """ +const String ne = ''' नेपाल नेपाल (आधिकारिक नाम: सङ्घीय लोकतान्त्रिक गणतन्त्र नेपाल) दक्षिण एसियाली भूपरिवेष्ठित हिमाली राष्ट्र हो । यसको भौगोलिक अक्षांश २६ डिग्री २२ मिनेटदेखि ३० डिग्री २७ मिनेट उत्तर र ८० डिग्री ४ मिनेटदेखि ८८ डिग्री १२ मिनेट पूर्वी देशान्तरसम्म फैलिएको छ । यसको कूल क्षेत्रफल १,४७,१८१ वर्ग कि.मि छ । यो क्षेत्रफल पृथ्वीको कूल क्षेत्रफलको ०.०३% र एसिया महादेशको ०.३% पर्दछ । लण्डन स्थित "ग्रीनवीच मिनटाइम" भन्दा पूर्वतर्फ रहेकोले गौरीशङ्कर हिमालको नजिक भएर जाने ८६ डिग्री १५ मिनेट पूर्वी देशान्तरलाई आधार मानी नेपालको प्रमाणिक समय ५ घण्टा ४५ मिनेट आगाडि मानिएको छ । @@ -21,4 +21,4 @@ const String ne = """ हिमालय क्षेत्रमा मानिसहरू बस्न थालेको कम्तिमा पनि ९,००० वर्ष भएको कुरा काठमाडौं उपत्यकामा पाइएका प्राचीन औजारहरूबाट पुष्टि हुन्छ। सम्भवत: भोट-बर्मेली मूलका मानिसहरू नेपालमा २,५०० वर्ष अगाडि बसोबास गर्दथे। ईशापूर्व १५०० तिर इन्डो-आर्यन जातिहरू उपत्यका प्रवेश गरे। ईशापूर्वको १००० तिर स-साना राज्यहरू र राज्यसङ्गठनहरू बने। सिद्धार्थ गौतम (ईशापूर्व ५६३–४८३) त्यस्तै एक वंश, शाक्यवंशका राजकुमार थिए, जसले आफ्नो राजकाज त्यागी तपस्वीको जीवन अँगाले र उनी बुद्ध भनेर विश्व प्रसिद्ध भए। -ईशापूर्वको २५० सम्ममा, यो क्षेत्र उत्तर"""; +ईशापूर्वको २५० सम्ममा, यो क्षेत्र उत्तर'''; diff --git a/benchmarks/Utf8Decode/dart/rutext_2_10k.dart b/benchmarks/Utf8Decode/dart/rutext_2_10k.dart index 50b0130e471..c61a665739c 100644 --- a/benchmarks/Utf8Decode/dart/rutext_2_10k.dart +++ b/benchmarks/Utf8Decode/dart/rutext_2_10k.dart @@ -7,7 +7,7 @@ // The material is licensed under the Creative Commons Attribution-Share-Alike // License 3.0: https://creativecommons.org/licenses/by-sa/3.0/ -const String ru = """ +const String ru = ''' Литва Литва́ (), официальное название Лито́вская Респу́блика () государство, расположенное в северной части Европы. Столица страны Вильнюс. @@ -41,4 +41,4 @@ const String ru = """ В XIV  начале XV веках территория Великого княжества Литовского стремительно росла, в основном за счёт присоединения земель Западной Руси. Включение в состав государства славянских земель, многократно превышающих по площади и количеству населения собственно литовские земли, привело к перениманию литовскими князьями, получившими во владение русские земли, православной культуры и западнорусского языка. Со временем западнорусский язык стал официальным языком канцелярии великих князей. Собственно литовский язык до XVI века оставался бесписьменным, хотя и продолжал использоваться на этнически литовских землях. -В 1385 году великий князь литовский Ягайло заключил Кревскую унию с Королевством Польским. По условиям унии, Ягайло обязался присоединить Великое княжество Литовское к Королевству Польскому и крестить литовские земли по католическому обряду, а сам становился королём Польши и сохранял титул великого князя литовского. Однако вскоре он вынужден был уступить власть в Великом княжестве Литовском своему двоюродному брату Витовту."""; +В 1385 году великий князь литовский Ягайло заключил Кревскую унию с Королевством Польским. По условиям унии, Ягайло обязался присоединить Великое княжество Литовское к Королевству Польскому и крестить литовские земли по католическому обряду, а сам становился королём Польши и сохранял титул великого князя литовского. Однако вскоре он вынужден был уступить власть в Великом княжестве Литовском своему двоюродному брату Витовту.'''; diff --git a/benchmarks/Utf8Decode/dart/sktext_10k.dart b/benchmarks/Utf8Decode/dart/sktext_10k.dart index b1ce2512e9c..7dc2d133ec6 100644 --- a/benchmarks/Utf8Decode/dart/sktext_10k.dart +++ b/benchmarks/Utf8Decode/dart/sktext_10k.dart @@ -7,7 +7,7 @@ // The material is licensed under the Creative Commons Attribution-Share-Alike // License 3.0: https://creativecommons.org/licenses/by-sa/3.0/ -const String sk = """ +const String sk = ''' Esperanto (pôvodne Lingvo Internacia – „medzinárodný jazyk“) je najrozšírenejší medzinárodný plánový jazyk. Názov je odvodený od pseudonymu, pod ktorým v roku 1887 zverejnil lekár L. L. Zamenhof základy tohto jazyka. Zámerom tvorcu bolo vytvoriť ľahko naučiteľný a použiteľný neutrálny jazyk, vhodný na použitie v medzinárodnej komunikácii. Cieľom nebolo nahradiť národné jazyky, čo bolo neskôr aj deklarované v Boulonskej deklarácii. Hoci žiaden štát neprijal esperanto ako úradný jazyk, používa ho komunita s odhadovaným počtom hovoriacich 100 000 až 2 000 000, z čoho približne 2 000 tvoria rodení hovoriaci. V Poľsku je na zozname nemateriálneho kultúrneho dedičstva. Získalo aj isté medzinárodné uznania, napríklad dve rezolúcie UNESCO či podporu známych osobností verejného života. V súčasnosti sa esperanto využíva pri cestovaní, korešpondencii, medzinárodných stretnutiach a kultúrnych výmenách, kongresoch, vedeckých diskusiách, v pôvodnej aj prekladovej literatúre, divadle a kine, hudbe, tlačenom aj internetovom spravodajstve, rozhlasovom a televíznom vysielaní. @@ -43,4 +43,4 @@ Už na začiatku 20. storočia bolo na území dnešného Slovenska (vtedy sever Po prvej svetovej vojne sa oba pražské spolky zlúčili do "Československej Esperantskej Asociácie". Tá bola v roku 1936 premenovaná na "Esperantskú Asociáciu v Československej republike". V tomto období bolo hnutie veľmi aktívne, fungovalo mnoho klubov, konalo sa veľa prednášok a kurzov. Esperanto bolo vyučované na školách rôznych stupňov, rádio Bratislava od 1930 vysielalo kurzy a od 1932 aj kultúrny program v esperante. Bola vydaná "Československá antológia" predstavujúca diela 20 slovenských autorov. V rámci protifašistickej aktivity vychádzali aj preklady protifašistických článkov z esperantských časopisov z obdobia Španielskej občianskej vojny. -Druhá svetová vojna utlmila esperantské hnutie. Bratislavský esperantský klub požiadal o zmenu štatútu a rozšírenie poľa pôsobnosti na celú vtedajšiu Slovenskú republiku a následne sa stal strediskom esperantského hnutia na Slovensku."""; +Druhá svetová vojna utlmila esperantské hnutie. Bratislavský esperantský klub požiadal o zmenu štatútu a rozšírenie poľa pôsobnosti na celú vtedajšiu Slovenskú republiku a následne sa stal strediskom esperantského hnutia na Slovensku.'''; diff --git a/benchmarks/Utf8Decode/dart/zhtext_10k.dart b/benchmarks/Utf8Decode/dart/zhtext_10k.dart index dc81c6d6d35..b5e2a541298 100644 --- a/benchmarks/Utf8Decode/dart/zhtext_10k.dart +++ b/benchmarks/Utf8Decode/dart/zhtext_10k.dart @@ -7,7 +7,7 @@ // The material is licensed under the Creative Commons Attribution-Share-Alike // License 3.0: https://creativecommons.org/licenses/by-sa/3.0/ -const String zh = """ +const String zh = ''' 最簡單的漢字只有一笔画,但卻不止一個字:除了「一」字以外,「乙」、「〇」、「丶」、「丨」、「亅」、「丿」、「乀」、「乁」、「𠄌」、「𠃋」、「𠃉」、「𠃊」、「乚」等都是漢字,而且都有各自的讀音。 中文汉字中,笔画最多的汉字可能是“”,是一种面食的名称,此字至今习用,其不同写法的笔画数在54至71画之间不等。被传统辞典收录的笔画最多的汉字为《字汇补》、《汉语大字典》中由四个“-{龍}-”字组成的「」字,共64画;同樣屬於64劃的字由四個“-{興}-”字組成的“𠔻”字,收入自《中文大辭典》;之後的是由四個「雷」字組成的“䨻”字,有52劃,收錄於《說文解字》。 @@ -70,4 +70,4 @@ const String zh = """ 随着各种中文输入法的出现,汉字的计算机输入、存储、输出技术得到了基本解决,大大提高了中文写作、出版、信息检索等的效率。目前中文输入法有上千种之多,主要包括表音输入和表形输入两类,也有两者兼之的。汉字的语音输入、手写识别和光学字符识别(OCR)技术也已得到广泛应用。 -如收录数千字的GB 2312(中國大陸)、B"""; +如收录数千字的GB 2312(中國大陸)、B'''; diff --git a/benchmarks/Utf8Decode/dart2/Utf8Decode.dart b/benchmarks/Utf8Decode/dart2/Utf8Decode.dart index a1b423dc048..7be3a8f39f3 100644 --- a/benchmarks/Utf8Decode/dart2/Utf8Decode.dart +++ b/benchmarks/Utf8Decode/dart2/Utf8Decode.dart @@ -26,11 +26,11 @@ class Utf8Decode extends BenchmarkBase { int totalOutputSize; static String _makeName(String language, int size, bool allowMalformed) { - String name = "Utf8Decode.$language."; + String name = 'Utf8Decode.$language.'; name += size >= 1000000 - ? "${size ~/ 1000000}M" - : size >= 1000 ? "${size ~/ 1000}k" : "$size"; - if (allowMalformed) name += ".malformed"; + ? '${size ~/ 1000000}M' + : size >= 1000 ? '${size ~/ 1000}k' : '$size'; + if (allowMalformed) name += '.malformed'; return name; } @@ -39,9 +39,9 @@ class Utf8Decode extends BenchmarkBase { @override void setup() { - Uint8List data = utf8.encode(text) as Uint8List; + final Uint8List data = utf8.encode(text) as Uint8List; if (data.length != 10000) { - throw "Expected input data of exactly 10000 bytes."; + throw 'Expected input data of exactly 10000 bytes.'; } if (size < data.length) { // Split into chunks. @@ -83,7 +83,7 @@ class Utf8Decode extends BenchmarkBase { lengthSum += s.length; } if (lengthSum != totalOutputSize) { - throw "Output length doesn't match expected."; + throw 'Output length doesn\'t match expected.'; } } @@ -108,21 +108,21 @@ class Utf8Decode extends BenchmarkBase { void report() { // Report time in nanoseconds. final double score = measure() * 1000.0; - print("$name(RunTime): $score ns."); + print('$name(RunTime): $score ns.'); } } void main(List args) { const texts = { - "en": en, - "da": da, - "sk": sk, - "ru": ru, - "ne": ne, - "zh": zh, + 'en': en, + 'da': da, + 'sk': sk, + 'ru': ru, + 'ne': ne, + 'zh': zh, }; final bool testMalformed = - args != null && args.isNotEmpty && args.first == "malformed"; + args != null && args.isNotEmpty && args.first == 'malformed'; final benchmarks = [ // Only benchmark with allowMalformed: false unless specified otherwise. for (bool allowMalformed in [false, if (testMalformed) true]) @@ -131,5 +131,7 @@ void main(List args) { () => Utf8Decode(language, texts[language], size, allowMalformed) ]; - benchmarks.forEach((bm) => bm().report()); + for (var bm in benchmarks) { + bm().report(); + } } diff --git a/benchmarks/Utf8Decode/dart2/datext_latin1_10k.dart b/benchmarks/Utf8Decode/dart2/datext_latin1_10k.dart index 866ff83cec8..bce6c80589b 100644 --- a/benchmarks/Utf8Decode/dart2/datext_latin1_10k.dart +++ b/benchmarks/Utf8Decode/dart2/datext_latin1_10k.dart @@ -7,7 +7,7 @@ // The material is licensed under the Creative Commons Attribution-Share-Alike // License 3.0: https://creativecommons.org/licenses/by-sa/3.0/ -const String da = """ +const String da = ''' Anders And Anders Fauntleroy And er en berømt figur i Disneys tegnefilm og tegneserier. Selv om han ikke er særligt populær i USA, optræder han i mange ugeblade i Europa: I Norge, Tyskland, Sverige, Danmark, Holland, Italien med flere. Hans første optræden var i tegnefilmen "The Wise Little Hen" (Den kloge lille høne) fra 9. juni 1934. Hans karakteristiske stemme blev indtalt af radiokomikeren Clarence Nash, der siden fast lagde stemme til. @@ -59,4 +59,4 @@ En mængde temaer var ofte i centrum for historierne, bl.a. tidsrejser og Tidspo Serien fik en fornyelse i 2001, hvilket ændrede markant på historierne. Everett Ducklair vender tilbage, slukker Globus, smider Stålanden ud af Ducklair Tower og genopretter sit gamle imperium. Undervejs bliver Ducklair's to døtre afsløret. De hader begge Everett af grunde, der ikke bliver afsløret til fulde, selvom det bliver antydet, at Everett skilte sig af med deres mor på en eller anden måde. Denne fornyelse holdt 18 numre, før serien blev afsluttet, dog uden at historierne fik en slutning. -Barks-historien "Anders And og den gyldne hjelm" fra 1954 kom i 2006 med i """; +Barks-historien "Anders And og den gyldne hjelm" fra 1954 kom i 2006 med i '''; diff --git a/benchmarks/Utf8Decode/dart2/entext_ascii_10k.dart b/benchmarks/Utf8Decode/dart2/entext_ascii_10k.dart index 9353d6dd56f..82cb7218946 100644 --- a/benchmarks/Utf8Decode/dart2/entext_ascii_10k.dart +++ b/benchmarks/Utf8Decode/dart2/entext_ascii_10k.dart @@ -7,7 +7,7 @@ // The material is licensed under the Creative Commons Attribution-Share-Alike // License 3.0: https://creativecommons.org/licenses/by-sa/3.0/ -const String en = """ +const String en = ''' Anarchism Anarchism is a radical political movement that is highly skeptical towards authority and rejects all forms of unjust hierarchy. It calls for the abolition of the state which it holds to be undesirable, unnecessary, and harmful. Anarchism advocates for the replacement of the state with stateless societies or other forms of free associations. @@ -32,4 +32,4 @@ Drawing from mutualism, Mikhail Bakunin founded collectivist anarchism and enter At the turning of the century, anarchism had spread all over the world. In China, small groups of students imported the humanistic pro-science version of anarcho-communism. Tokyo was a hotspot for rebellious youth from countries of the far east, pouring into the Japanese capital to study. In Latin America, So Paulo was a stronghold for anarcho-syndicalism where it became the most prominent left-wing ideology. During this time, a minority of anarchists adopted tactics of revolutionary political violence. This strategy became known as propaganda of the deed. The dismemberment of the French socialist movement into many groups and the execution and exile of many Communards to penal colonies following the suppression of the Paris Commune favoured individualist political expression and acts. Even though many anarchists distanced themselves from these terrorist acts, infamy came upon the movement. Illegalism was another strategy which some anarchists adopted these same years. Anarchists enthusiastically participated in the Russian Revolutiondespite concernsin opposition to the Whites. However, they met harsh suppression after the Bolshevik government was stabilized. Several anarchists from Petrograd and Moscow fled to Ukraine, notably leading to the Kronstadt rebellion and Nestor Makhno's struggle in the Free Territory. With the anarchists being crushed in Russia, two new antithetical currents emerged, namely platformism and synthesis anarchism. The former sought to create a coherent group that would push for the revolution while the latter were against anything that would resemble a political party. Seeing the victories of the Bolsheviks in the October Revolution and the resulting Russian Civil War, many workers and activists turned to communist parties which grew at the expense of anarchism and other socialist movements. In France and the United States, members of major syndicalist movements, the General Confederation of Labour and Industrial Workers of the World, left their organisations and joined the Communist International. -In the Spanish Civil War, anarchists and syndicalists (CNT and FAI) once again allied themselves with various currents of leftists. A long tradition of Spanish anarchism led to anarchists playing a pivotal role in the war. In response to the army rebellion, an anarchist-inspired movement of peasants and workers, supported by armed militias, took control of Barcelona and of large areas of rural Spain where they collectivised """; +In the Spanish Civil War, anarchists and syndicalists (CNT and FAI) once again allied themselves with various currents of leftists. A long tradition of Spanish anarchism led to anarchists playing a pivotal role in the war. In response to the army rebellion, an anarchist-inspired movement of peasants and workers, supported by armed militias, took control of Barcelona and of large areas of rural Spain where they collectivised '''; diff --git a/benchmarks/Utf8Decode/dart2/netext_3_10k.dart b/benchmarks/Utf8Decode/dart2/netext_3_10k.dart index be53bc3f142..8fce5509349 100644 --- a/benchmarks/Utf8Decode/dart2/netext_3_10k.dart +++ b/benchmarks/Utf8Decode/dart2/netext_3_10k.dart @@ -7,7 +7,7 @@ // The material is licensed under the Creative Commons Attribution-Share-Alike // License 3.0: https://creativecommons.org/licenses/by-sa/3.0/ -const String ne = """ +const String ne = ''' नेपाल नेपाल (आधिकारिक नाम: सङ्घीय लोकतान्त्रिक गणतन्त्र नेपाल) दक्षिण एसियाली भूपरिवेष्ठित हिमाली राष्ट्र हो । यसको भौगोलिक अक्षांश २६ डिग्री २२ मिनेटदेखि ३० डिग्री २७ मिनेट उत्तर र ८० डिग्री ४ मिनेटदेखि ८८ डिग्री १२ मिनेट पूर्वी देशान्तरसम्म फैलिएको छ । यसको कूल क्षेत्रफल १,४७,१८१ वर्ग कि.मि छ । यो क्षेत्रफल पृथ्वीको कूल क्षेत्रफलको ०.०३% र एसिया महादेशको ०.३% पर्दछ । लण्डन स्थित "ग्रीनवीच मिनटाइम" भन्दा पूर्वतर्फ रहेकोले गौरीशङ्कर हिमालको नजिक भएर जाने ८६ डिग्री १५ मिनेट पूर्वी देशान्तरलाई आधार मानी नेपालको प्रमाणिक समय ५ घण्टा ४५ मिनेट आगाडि मानिएको छ । @@ -21,4 +21,4 @@ const String ne = """ हिमालय क्षेत्रमा मानिसहरू बस्न थालेको कम्तिमा पनि ९,००० वर्ष भएको कुरा काठमाडौं उपत्यकामा पाइएका प्राचीन औजारहरूबाट पुष्टि हुन्छ। सम्भवत: भोट-बर्मेली मूलका मानिसहरू नेपालमा २,५०० वर्ष अगाडि बसोबास गर्दथे। ईशापूर्व १५०० तिर इन्डो-आर्यन जातिहरू उपत्यका प्रवेश गरे। ईशापूर्वको १००० तिर स-साना राज्यहरू र राज्यसङ्गठनहरू बने। सिद्धार्थ गौतम (ईशापूर्व ५६३–४८३) त्यस्तै एक वंश, शाक्यवंशका राजकुमार थिए, जसले आफ्नो राजकाज त्यागी तपस्वीको जीवन अँगाले र उनी बुद्ध भनेर विश्व प्रसिद्ध भए। -ईशापूर्वको २५० सम्ममा, यो क्षेत्र उत्तर"""; +ईशापूर्वको २५० सम्ममा, यो क्षेत्र उत्तर'''; diff --git a/benchmarks/Utf8Decode/dart2/rutext_2_10k.dart b/benchmarks/Utf8Decode/dart2/rutext_2_10k.dart index 50b0130e471..c61a665739c 100644 --- a/benchmarks/Utf8Decode/dart2/rutext_2_10k.dart +++ b/benchmarks/Utf8Decode/dart2/rutext_2_10k.dart @@ -7,7 +7,7 @@ // The material is licensed under the Creative Commons Attribution-Share-Alike // License 3.0: https://creativecommons.org/licenses/by-sa/3.0/ -const String ru = """ +const String ru = ''' Литва Литва́ (), официальное название Лито́вская Респу́блика () государство, расположенное в северной части Европы. Столица страны Вильнюс. @@ -41,4 +41,4 @@ const String ru = """ В XIV  начале XV веках территория Великого княжества Литовского стремительно росла, в основном за счёт присоединения земель Западной Руси. Включение в состав государства славянских земель, многократно превышающих по площади и количеству населения собственно литовские земли, привело к перениманию литовскими князьями, получившими во владение русские земли, православной культуры и западнорусского языка. Со временем западнорусский язык стал официальным языком канцелярии великих князей. Собственно литовский язык до XVI века оставался бесписьменным, хотя и продолжал использоваться на этнически литовских землях. -В 1385 году великий князь литовский Ягайло заключил Кревскую унию с Королевством Польским. По условиям унии, Ягайло обязался присоединить Великое княжество Литовское к Королевству Польскому и крестить литовские земли по католическому обряду, а сам становился королём Польши и сохранял титул великого князя литовского. Однако вскоре он вынужден был уступить власть в Великом княжестве Литовском своему двоюродному брату Витовту."""; +В 1385 году великий князь литовский Ягайло заключил Кревскую унию с Королевством Польским. По условиям унии, Ягайло обязался присоединить Великое княжество Литовское к Королевству Польскому и крестить литовские земли по католическому обряду, а сам становился королём Польши и сохранял титул великого князя литовского. Однако вскоре он вынужден был уступить власть в Великом княжестве Литовском своему двоюродному брату Витовту.'''; diff --git a/benchmarks/Utf8Decode/dart2/sktext_10k.dart b/benchmarks/Utf8Decode/dart2/sktext_10k.dart index b1ce2512e9c..7dc2d133ec6 100644 --- a/benchmarks/Utf8Decode/dart2/sktext_10k.dart +++ b/benchmarks/Utf8Decode/dart2/sktext_10k.dart @@ -7,7 +7,7 @@ // The material is licensed under the Creative Commons Attribution-Share-Alike // License 3.0: https://creativecommons.org/licenses/by-sa/3.0/ -const String sk = """ +const String sk = ''' Esperanto (pôvodne Lingvo Internacia – „medzinárodný jazyk“) je najrozšírenejší medzinárodný plánový jazyk. Názov je odvodený od pseudonymu, pod ktorým v roku 1887 zverejnil lekár L. L. Zamenhof základy tohto jazyka. Zámerom tvorcu bolo vytvoriť ľahko naučiteľný a použiteľný neutrálny jazyk, vhodný na použitie v medzinárodnej komunikácii. Cieľom nebolo nahradiť národné jazyky, čo bolo neskôr aj deklarované v Boulonskej deklarácii. Hoci žiaden štát neprijal esperanto ako úradný jazyk, používa ho komunita s odhadovaným počtom hovoriacich 100 000 až 2 000 000, z čoho približne 2 000 tvoria rodení hovoriaci. V Poľsku je na zozname nemateriálneho kultúrneho dedičstva. Získalo aj isté medzinárodné uznania, napríklad dve rezolúcie UNESCO či podporu známych osobností verejného života. V súčasnosti sa esperanto využíva pri cestovaní, korešpondencii, medzinárodných stretnutiach a kultúrnych výmenách, kongresoch, vedeckých diskusiách, v pôvodnej aj prekladovej literatúre, divadle a kine, hudbe, tlačenom aj internetovom spravodajstve, rozhlasovom a televíznom vysielaní. @@ -43,4 +43,4 @@ Už na začiatku 20. storočia bolo na území dnešného Slovenska (vtedy sever Po prvej svetovej vojne sa oba pražské spolky zlúčili do "Československej Esperantskej Asociácie". Tá bola v roku 1936 premenovaná na "Esperantskú Asociáciu v Československej republike". V tomto období bolo hnutie veľmi aktívne, fungovalo mnoho klubov, konalo sa veľa prednášok a kurzov. Esperanto bolo vyučované na školách rôznych stupňov, rádio Bratislava od 1930 vysielalo kurzy a od 1932 aj kultúrny program v esperante. Bola vydaná "Československá antológia" predstavujúca diela 20 slovenských autorov. V rámci protifašistickej aktivity vychádzali aj preklady protifašistických článkov z esperantských časopisov z obdobia Španielskej občianskej vojny. -Druhá svetová vojna utlmila esperantské hnutie. Bratislavský esperantský klub požiadal o zmenu štatútu a rozšírenie poľa pôsobnosti na celú vtedajšiu Slovenskú republiku a následne sa stal strediskom esperantského hnutia na Slovensku."""; +Druhá svetová vojna utlmila esperantské hnutie. Bratislavský esperantský klub požiadal o zmenu štatútu a rozšírenie poľa pôsobnosti na celú vtedajšiu Slovenskú republiku a následne sa stal strediskom esperantského hnutia na Slovensku.'''; diff --git a/benchmarks/Utf8Decode/dart2/zhtext_10k.dart b/benchmarks/Utf8Decode/dart2/zhtext_10k.dart index dc81c6d6d35..b5e2a541298 100644 --- a/benchmarks/Utf8Decode/dart2/zhtext_10k.dart +++ b/benchmarks/Utf8Decode/dart2/zhtext_10k.dart @@ -7,7 +7,7 @@ // The material is licensed under the Creative Commons Attribution-Share-Alike // License 3.0: https://creativecommons.org/licenses/by-sa/3.0/ -const String zh = """ +const String zh = ''' 最簡單的漢字只有一笔画,但卻不止一個字:除了「一」字以外,「乙」、「〇」、「丶」、「丨」、「亅」、「丿」、「乀」、「乁」、「𠄌」、「𠃋」、「𠃉」、「𠃊」、「乚」等都是漢字,而且都有各自的讀音。 中文汉字中,笔画最多的汉字可能是“”,是一种面食的名称,此字至今习用,其不同写法的笔画数在54至71画之间不等。被传统辞典收录的笔画最多的汉字为《字汇补》、《汉语大字典》中由四个“-{龍}-”字组成的「」字,共64画;同樣屬於64劃的字由四個“-{興}-”字組成的“𠔻”字,收入自《中文大辭典》;之後的是由四個「雷」字組成的“䨻”字,有52劃,收錄於《說文解字》。 @@ -70,4 +70,4 @@ const String zh = """ 随着各种中文输入法的出现,汉字的计算机输入、存储、输出技术得到了基本解决,大大提高了中文写作、出版、信息检索等的效率。目前中文输入法有上千种之多,主要包括表音输入和表形输入两类,也有两者兼之的。汉字的语音输入、手写识别和光学字符识别(OCR)技术也已得到广泛应用。 -如收录数千字的GB 2312(中國大陸)、B"""; +如收录数千字的GB 2312(中國大陸)、B''';