Files
swift-mirror/utils/benchmark/Strings/CPPStringSort.cpp
2014-02-13 23:23:58 +00:00

1025 lines
19 KiB
C++

#include <mach/mach_time.h>
#include <string>
#include <vector>
#include <stdio.h>
// Remember to build with C++11
int
main(void) {
std::vector<std::wstring> words {
L"woodshed",
L"lakism",
L"gastroperiodynia",
L"afetal",
L"ramsch",
L"Nickieben",
L"undutifulness",
L"birdglue",
L"ungentlemanize",
L"menacingly",
L"heterophile",
L"leoparde",
L"Casearia",
L"decorticate",
L"neognathic",
L"mentionable",
L"tetraphenol",
L"pseudonymal",
L"dislegitimate",
L"Discoidea",
L"intitule",
L"ionium",
L"Lotuko",
L"timbering",
L"nonliquidating",
L"oarialgia",
L"Saccobranchus",
L"reconnoiter",
L"criminative",
L"disintegratory",
L"executer",
L"Cylindrosporium",
L"complimentation",
L"Ixiama",
L"Araceae",
L"silaginoid",
L"derencephalus",
L"Lamiidae",
L"marrowlike",
L"ninepin",
L"dynastid",
L"lampfly",
L"feint",
L"trihemimer",
L"semibarbarous",
L"heresy",
L"tritanope",
L"indifferentist",
L"confound",
L"hyperbolaeon",
L"planirostral",
L"philosophunculist",
L"existence",
L"fretless",
L"Leptandra",
L"Amiranha",
L"handgravure",
L"gnash",
L"unbelievability",
L"orthotropic",
L"Susumu",
L"teleutospore",
L"sleazy",
L"shapeliness",
L"hepatotomy",
L"exclusivism",
L"stifler",
L"cunning",
L"isocyanuric",
L"pseudepigraphy",
L"carpetbagger",
L"respectiveness",
L"Jussi",
L"vasotomy",
L"proctotomy",
L"ovatotriangular",
L"aesthetic",
L"schizogamy",
L"disengagement",
L"foray",
L"haplocaulescent",
L"noncoherent",
L"astrocyte",
L"unreverberated",
L"presenile",
L"lanson",
L"enkraal",
L"contemplative",
L"Syun",
L"sartage",
L"unforgot",
L"wyde",
L"homeotransplant",
L"implicational",
L"forerunnership",
L"calcaneum",
L"stomatodeum",
L"pharmacopedia",
L"preconcessive",
L"trypanosomatic",
L"intracollegiate",
L"rampacious",
L"secundipara",
L"isomeric",
L"treehair",
L"pulmonal",
L"uvate",
L"dugway",
L"glucofrangulin",
L"unglory",
L"Amandus",
L"icterogenetic",
L"quadrireme",
L"Lagostomus",
L"brakeroot",
L"anthracemia",
L"fluted",
L"protoelastose",
L"thro",
L"pined",
L"Saxicolinae",
L"holidaymaking",
L"strigil",
L"uncurbed",
L"starling",
L"redeemeress",
L"Liliaceae",
L"imparsonee",
L"obtusish",
L"brushed",
L"mesally",
L"probosciformed",
L"Bourbonesque",
L"histological",
L"caroba",
L"digestion",
L"Vindemiatrix",
L"triactinal",
L"tattling",
L"arthrobacterium",
L"unended",
L"suspectfulness",
L"movelessness",
L"chartist",
L"Corynebacterium",
L"tercer",
L"oversaturation",
L"Congoleum",
L"antiskeptical",
L"sacral",
L"equiradiate",
L"whiskerage",
L"panidiomorphic",
L"unplanned",
L"anilopyrine",
L"Queres",
L"tartronyl",
L"Ing",
L"notehead",
L"finestiller",
L"weekender",
L"kittenhood",
L"competitrix",
L"premillenarian",
L"convergescence",
L"microcoleoptera",
L"slirt",
L"asteatosis",
L"Gruidae",
L"metastome",
L"ambuscader",
L"untugged",
L"uneducated",
L"redistill",
L"rushlight",
L"freakish",
L"dosology",
L"papyrine",
L"iconologist",
L"Bidpai",
L"prophethood",
L"pneumotropic",
L"chloroformize",
L"intemperance",
L"spongiform",
L"superindignant",
L"divider",
L"starlit",
L"merchantish",
L"indexless",
L"unidentifiably",
L"coumarone",
L"nomism",
L"diaphanous",
L"salve",
L"option",
L"anallantoic",
L"paint",
L"thiofurfuran",
L"baddeleyite",
L"Donne",
L"heterogenicity",
L"decess",
L"eschynite",
L"mamma",
L"unmonarchical",
L"Archiplata",
L"widdifow",
L"apathic",
L"overline",
L"chaetophoraceous",
L"creaky",
L"trichosporange",
L"uninterlined",
L"cometwise",
L"hermeneut",
L"unbedraggled",
L"tagged",
L"Sminthurus",
L"somniloquacious",
L"aphasiac",
L"Inoperculata",
L"photoactivity",
L"mobship",
L"unblightedly",
L"lievrite",
L"Khoja",
L"Falerian",
L"milfoil",
L"protectingly",
L"householder",
L"cathedra",
L"calmingly",
L"tordrillite",
L"rearhorse",
L"Leonard",
L"maracock",
L"youngish",
L"kammererite",
L"metanephric",
L"Sageretia",
L"diplococcoid",
L"accelerative",
L"choreal",
L"metalogical",
L"recombination",
L"unimprison",
L"invocation",
L"syndetic",
L"toadback",
L"vaned",
L"cupholder",
L"metropolitanship",
L"paramandelic",
L"dermolysis",
L"Sheriyat",
L"rhabdus",
L"seducee",
L"encrinoid",
L"unsuppliable",
L"cololite",
L"timesaver",
L"preambulate",
L"sampling",
L"roaster",
L"springald",
L"densher",
L"protraditional",
L"naturalesque",
L"Hydrodamalis",
L"cytogenic",
L"shortly",
L"cryptogrammatical",
L"squat",
L"genual",
L"backspier",
L"solubleness",
L"macroanalytical",
L"overcovetousness",
L"Natalie",
L"cuprobismutite",
L"phratriac",
L"Montanize",
L"hymnologist",
L"karyomiton",
L"podger",
L"unofficiousness",
L"antisplasher",
L"supraclavicular",
L"calidity",
L"disembellish",
L"antepredicament",
L"recurvirostral",
L"pulmonifer",
L"coccidial",
L"botonee",
L"protoglobulose",
L"isonym",
L"myeloid",
L"premiership",
L"unmonopolize",
L"unsesquipedalian",
L"unfelicitously",
L"theftbote",
L"undauntable",
L"lob",
L"praenomen",
L"underriver",
L"gorfly",
L"pluckage",
L"radiovision",
L"tyrantship",
L"fraught",
L"doppelkummel",
L"rowan",
L"allosyndetic",
L"kinesiology",
L"psychopath",
L"arrent",
L"amusively",
L"preincorporation",
L"Montargis",
L"pentacron",
L"neomedievalism",
L"sima",
L"lichenicolous",
L"Ecclesiastes",
L"woofed",
L"cardinalist",
L"sandaracin",
L"gymnasial",
L"lithoglyptics",
L"centimeter",
L"quadrupedous",
L"phraseology",
L"tumuli",
L"ankylotomy",
L"myrtol",
L"cohibitive",
L"lepospondylous",
L"silvendy",
L"inequipotential",
L"entangle",
L"raveling",
L"Zeugobranchiata",
L"devastating",
L"grainage",
L"amphisbaenian",
L"blady",
L"cirrose",
L"proclericalism",
L"governmentalist",
L"carcinomorphic",
L"nurtureship",
L"clancular",
L"unsteamed",
L"discernibly",
L"pleurogenic",
L"impalpability",
L"Azotobacterieae",
L"sarcoplasmic",
L"alternant",
L"fitly",
L"acrorrheuma",
L"shrapnel",
L"pastorize",
L"gulflike",
L"foreglow",
L"unrelated",
L"cirriped",
L"cerviconasal",
L"sexuale",
L"pussyfooter",
L"gadolinic",
L"duplicature",
L"codelinquency",
L"trypanolysis",
L"pathophobia",
L"incapsulation",
L"nonaerating",
L"feldspar",
L"diaphonic",
L"epiglottic",
L"depopulator",
L"wisecracker",
L"gravitational",
L"kuba",
L"lactesce",
L"Toxotes",
L"periomphalic",
L"singstress",
L"fannier",
L"counterformula",
L"Acemetae",
L"repugnatorial",
L"collimator",
L"Acinetina",
L"unpeace",
L"drum",
L"tetramorphic",
L"descendentalism",
L"cementer",
L"supraloral",
L"intercostal",
L"Nipponize",
L"negotiator",
L"vacationless",
L"synthol",
L"fissureless",
L"resoap",
L"pachycarpous",
L"reinspiration",
L"misappropriation",
L"disdiazo",
L"unheatable",
L"streng",
L"Detroiter",
L"infandous",
L"loganiaceous",
L"desugar",
L"Matronalia",
L"myxocystoma",
L"Gandhiism",
L"kiddier",
L"relodge",
L"counterreprisal",
L"recentralize",
L"foliously",
L"reprinter",
L"gender",
L"edaciousness",
L"chondriomite",
L"concordant",
L"stockrider",
L"pedary",
L"shikra",
L"blameworthiness",
L"vaccina",
L"Thamnophilinae",
L"wrongwise",
L"unsuperannuated",
L"convalescency",
L"intransmutable",
L"dropcloth",
L"Ceriomyces",
L"ponderal",
L"unstentorian",
L"mem",
L"deceleration",
L"ethionic",
L"untopped",
L"wetback",
L"bebar",
L"undecaying",
L"shoreside",
L"energize",
L"presacral",
L"undismay",
L"agricolite",
L"cowheart",
L"hemibathybian",
L"postexilian",
L"Phacidiaceae",
L"offing",
L"redesignation",
L"skeptically",
L"physicianless",
L"bronchopathy",
L"marabuto",
L"proprietory",
L"unobtruded",
L"funmaker",
L"plateresque",
L"preadventure",
L"beseeching",
L"cowpath",
L"pachycephalia",
L"arthresthesia",
L"supari",
L"lengthily",
L"Nepa",
L"liberation",
L"nigrify",
L"belfry",
L"entoolitic",
L"bazoo",
L"pentachromic",
L"distinguishable",
L"slideable",
L"galvanoscope",
L"remanage",
L"cetene",
L"bocardo",
L"consummation",
L"boycottism",
L"perplexity",
L"astay",
L"Gaetuli",
L"periplastic",
L"consolidator",
L"sluggarding",
L"coracoscapular",
L"anangioid",
L"oxygenizer",
L"Hunanese",
L"seminary",
L"periplast",
L"Corylus",
L"unoriginativeness",
L"persecutee",
L"tweaker",
L"silliness",
L"Dabitis",
L"facetiousness",
L"thymy",
L"nonimperial",
L"mesoblastema",
L"turbiniform",
L"churchway",
L"cooing",
L"frithbot",
L"concomitantly",
L"stalwartize",
L"clingfish",
L"hardmouthed",
L"parallelepipedonal",
L"coracoacromial",
L"factuality",
L"curtilage",
L"arachnoidean",
L"semiaridity",
L"phytobacteriology",
L"premastery",
L"hyperpurist",
L"mobed",
L"opportunistic",
L"acclimature",
L"outdistance",
L"sophister",
L"condonement",
L"oxygenerator",
L"acetonic",
L"emanatory",
L"periphlebitis",
L"nonsociety",
L"spectroradiometric",
L"superaverage",
L"cleanness",
L"posteroventral",
L"unadvised",
L"unmistakedly",
L"pimgenet",
L"auresca",
L"overimitate",
L"dipnoan",
L"chromoxylograph",
L"triakistetrahedron",
L"Suessiones",
L"uncopiable",
L"oligomenorrhea",
L"fribbling",
L"worriable",
L"flot",
L"ornithotrophy",
L"phytoteratology",
L"setup",
L"lanneret",
L"unbraceleted",
L"gudemother",
L"Spica",
L"unconsolatory",
L"recorruption",
L"premenstrual",
L"subretinal",
L"millennialist",
L"subjectibility",
L"rewardproof",
L"counterflight",
L"pilomotor",
L"carpetbaggery",
L"macrodiagonal",
L"slim",
L"indiscernible",
L"cuckoo",
L"moted",
L"controllingly",
L"gynecopathy",
L"porrectus",
L"wanworth",
L"lutfisk",
L"semiprivate",
L"philadelphy",
L"abdominothoracic",
L"coxcomb",
L"dambrod",
L"Metanemertini",
L"balminess",
L"homotypy",
L"waremaker",
L"absurdity",
L"gimcrack",
L"asquat",
L"suitable",
L"perimorphous",
L"kitchenwards",
L"pielum",
L"salloo",
L"paleontologic",
L"Olson",
L"Tellinidae",
L"ferryman",
L"peptonoid",
L"Bopyridae",
L"fallacy",
L"ictuate",
L"aguinaldo",
L"rhyodacite",
L"Ligydidae",
L"galvanometric",
L"acquisitor",
L"muscology",
L"hemikaryon",
L"ethnobotanic",
L"postganglionic",
L"rudimentarily",
L"replenish",
L"phyllorhine",
L"popgunnery",
L"summar",
L"quodlibetary",
L"xanthochromia",
L"autosymbolically",
L"preloreal",
L"extent",
L"strawberry",
L"immortalness",
L"colicwort",
L"frisca",
L"electiveness",
L"heartbroken",
L"affrightingly",
L"reconfiscation",
L"jacchus",
L"imponderably",
L"semantics",
L"beennut",
L"paleometeorological",
L"becost",
L"timberwright",
L"resuppose",
L"syncategorematical",
L"cytolymph",
L"steinbok",
L"explantation",
L"hyperelliptic",
L"antescript",
L"blowdown",
L"antinomical",
L"caravanserai",
L"unweariedly",
L"isonymic",
L"keratoplasty",
L"vipery",
L"parepigastric",
L"endolymphatic",
L"Londonese",
L"necrotomy",
L"angelship",
L"Schizogregarinida",
L"steeplebush",
L"sparaxis",
L"connectedness",
L"tolerance",
L"impingent",
L"agglutinin",
L"reviver",
L"hieroglyphical",
L"dialogize",
L"coestate",
L"declamatory",
L"ventilation",
L"tauromachy",
L"cotransubstantiate",
L"pome",
L"underseas",
L"triquadrantal",
L"preconfinemnt",
L"electroindustrial",
L"selachostomous",
L"nongolfer",
L"mesalike",
L"hamartiology",
L"ganglioblast",
L"unsuccessive",
L"yallow",
L"bacchanalianly",
L"platydactyl",
L"Bucephala",
L"ultraurgent",
L"penalist",
L"catamenial",
L"lynnhaven",
L"unrelevant",
L"lunkhead",
L"metropolitan",
L"hydro",
L"outsoar",
L"vernant",
L"interlanguage",
L"catarrhal",
L"Ionicize",
L"keelless",
L"myomantic",
L"booker",
L"Xanthomonas",
L"unimpeded",
L"overfeminize",
L"speronaro",
L"diaconia",
L"overholiness",
L"liquefacient",
L"Spartium",
L"haggly",
L"albumose",
L"nonnecessary",
L"sulcalization",
L"decapitate",
L"cellated",
L"unguirostral",
L"trichiurid",
L"loveproof",
L"amakebe",
L"screet",
L"arsenoferratin",
L"unfrizz",
L"undiscoverable",
L"procollectivistic",
L"tractile",
L"Winona",
L"dermostosis",
L"eliminant",
L"scomberoid",
L"tensile",
L"typesetting",
L"xylic",
L"dermatopathology",
L"cycloplegic",
L"revocable",
L"fissate",
L"afterplay",
L"screwship",
L"microerg",
L"bentonite",
L"stagecoaching",
L"beglerbeglic",
L"overcharitably",
L"Plotinism",
L"Veddoid",
L"disequalize",
L"cytoproct",
L"trophophore",
L"antidote",
L"allerion",
L"famous",
L"convey",
L"postotic",
L"rapillo",
L"cilectomy",
L"penkeeper",
L"patronym",
L"bravely",
L"ureteropyelitis",
L"Hildebrandine",
L"missileproof",
L"Conularia",
L"deadening",
L"Conrad",
L"pseudochylous",
L"typologically",
L"strummer",
L"luxuriousness",
L"resublimation",
L"glossiness",
L"hydrocauline",
L"anaglyph",
L"personifiable",
L"seniority",
L"formulator",
L"datiscaceous",
L"hydracrylate",
L"Tyranni",
L"Crawthumper",
L"overprove",
L"masher",
L"dissonance",
L"Serpentinian",
L"malachite",
L"interestless",
L"stchi",
L"ogum",
L"polyspermic",
L"archegoniate",
L"precogitation",
L"Alkaphrah",
L"craggily",
L"delightfulness",
L"bioplast",
L"diplocaulescent",
L"neverland",
L"interspheral",
L"chlorhydric",
L"forsakenly",
L"scandium",
L"detubation",
L"telega",
L"Valeriana",
L"centraxonial",
L"anabolite",
L"neger",
L"miscellanea",
L"whalebacker",
L"stylidiaceous",
L"unpropelled",
L"Kennedya",
L"Jacksonite",
L"ghoulish",
L"Dendrocalamus",
L"paynimhood",
L"rappist",
L"unluffed",
L"falling",
L"Lyctus",
L"uncrown",
L"warmly",
L"pneumatism",
L"Morisonian",
L"notate",
L"isoagglutinin",
L"Pelidnota",
L"previsit",
L"contradistinctly",
L"utter",
L"porometer",
L"gie",
L"germanization",
L"betwixt",
L"prenephritic",
L"underpier",
L"Eleutheria",
L"ruthenious",
L"convertor",
L"antisepsin",
L"winterage",
L"tetramethylammonium",
L"Rockaway",
L"Penaea",
L"prelatehood",
L"brisket",
L"unwishful",
L"Minahassa",
L"Briareus",
L"semiaxis",
L"disintegrant",
L"peastick",
L"iatromechanical",
L"fastus",
L"thymectomy",
L"ladyless",
L"unpreened",
L"overflutter",
L"sicker",
L"apsidally",
L"thiazine",
L"guideway",
L"pausation",
L"tellinoid",
L"abrogative",
L"foraminulate",
L"omphalos",
L"Monorhina",
L"polymyarian",
L"unhelpful",
L"newslessness",
L"oryctognosy",
L"octoradial",
L"doxology",
L"arrhythmy",
L"gugal",
L"mesityl",
L"hexaplaric",
L"Cabirian",
L"hordeiform",
L"eddyroot",
L"internarial",
L"deservingness",
L"jawbation",
L"orographically",
L"semiprecious",
L"seasick",
L"thermically",
L"grew",
L"tamability",
L"egotistically",
L"fip",
L"preabsorbent",
L"leptochroa",
L"ethnobotany",
L"podolite",
L"egoistic",
L"semitropical",
L"cero",
L"spinelessness",
L"onshore",
L"omlah",
L"tintinnabulist",
L"machila",
L"entomotomy",
L"nubile",
L"nonscholastic",
L"burnt",
L"Alea",
L"befume",
L"doctorless",
L"Napoleonic",
L"scenting",
L"apokreos",
L"cresylene",
L"paramide",
L"rattery",
L"disinterested",
L"idiopathetic",
L"negatory",
L"fervid",
L"quintato",
L"untricked",
L"Metrosideros",
L"mescaline",
L"midverse",
L"Musophagidae",
L"fictionary",
L"branchiostegous",
L"yoker",
L"residuum",
L"culmigenous",
L"fleam",
L"suffragism",
L"Anacreon",
L"sarcodous",
L"parodistic",
L"writmaking",
L"conversationism",
L"retroposed",
L"tornillo",
L"presuspect",
L"didymous",
L"Saumur",
L"spicing",
L"drawbridge",
L"cantor",
L"incumbrancer",
L"heterospory",
L"Turkeydom",
L"anteprandial",
L"neighbourship",
L"thatchless",
L"drepanoid",
L"lusher",
L"paling",
L"ecthlipsis",
L"heredosyphilitic",
L"although",
L"garetta",
L"temporarily",
L"Monotropa",
L"proglottic",
L"calyptro",
L"persiflage",
L"degradable",
L"paraspecific",
L"undecorative",
L"Pholas",
L"myelon",
L"resteal",
L"quadrantly",
L"scrimped",
L"airer",
L"deviless",
L"caliciform",
L"Sefekhet",
L"shastaite",
L"togate",
L"macrostructure",
L"bipyramid",
L"wey",
L"didynamy",
L"knacker",
L"swage",
L"supermanism",
L"epitheton",
L"overpresumptuous"
};
asm volatile("" ::: "memory");
uint64_t start = mach_absolute_time();
sort(words.begin(), words.end());
uint64_t delta = mach_absolute_time() - start;
asm volatile("" : "+m" (words));
printf("%llu nanoseconds\n", delta);
return 0;
}