{"id":21570576,"url":"https://github.com/jcash/languagetests","last_synced_at":"2025-03-18T06:14:20.012Z","repository":{"id":151219626,"uuid":"14255896","full_name":"JCash/languagetests","owner":"JCash","description":"A simple speed comparison between languages","archived":false,"fork":false,"pushed_at":"2017-08-08T10:11:29.000Z","size":26,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-24T12:45:32.976Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JCash.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-11-09T11:13:00.000Z","updated_at":"2017-08-08T10:11:30.000Z","dependencies_parsed_at":"2023-06-26T09:30:19.893Z","dependency_job_id":null,"html_url":"https://github.com/JCash/languagetests","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JCash%2Flanguagetests","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JCash%2Flanguagetests/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JCash%2Flanguagetests/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JCash%2Flanguagetests/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JCash","download_url":"https://codeload.github.com/JCash/languagetests/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244166758,"owners_count":20409179,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-24T11:13:09.861Z","updated_at":"2025-03-18T06:14:20.007Z","avatar_url":"https://github.com/JCash.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"Language Tests\n==============\n\nThis is my quite unscientific playground for comparing execution times between languages and platforms\nin different situations. I choose the languages I usually work with or are interested in working with.\n\nFor instance, I've heard it so many times that Python is slower than c++ so I start to wonder exactly\n''how'' much slower it is. And people always talk so fondly about C#, so how does that perform?\n\n\nResults\n=======\n\nhttp://jcash.github.io/languagetests/\n\n\nImplementation Details\n======================\n\nSince C++ doesn't have a built in big int implementation, I first used the InfInt (https://code.google.com/p/infint).\nI also tried the BigInteger (https://mattmccutchen.net/bigint) and bigInt (http://netcologne.dl.sourceforge.net/project/cpp-bigint).\nAfter trying these out, I felt that I needed more \"production quality\" (i.e. speed) so I tried GMP (http://gmplib.org/).\n\nHere is an example of timings for C++ big int classes (if you are looking into one).\n\nFactorial(n=400) (time in microseconds):\n\u003ctable\u003e\n    \u003ctr\u003e\u003ctd\u003eLib\u003c/td\u003e\u003ctd\u003eTime (us)\u003c/td\u003e\u003c/tr\u003e\n    \u003ctr\u003e\u003ctd\u003egmp\u003c/td\u003e\u003ctd\u003e~13.7\u003c/td\u003e\u003c/tr\u003e\n    \u003ctr\u003e\u003ctd\u003eInfInt\u003c/td\u003e\u003ctd\u003e~107\u003c/td\u003e\u003c/tr\u003e\n    \u003ctr\u003e\u003ctd\u003eBigInteger\u003c/td\u003e\u003ctd\u003e~4100\u003c/td\u003e\u003c/tr\u003e\n    \u003ctr\u003e\u003ctd\u003ebigInt\u003c/td\u003e\u003ctd\u003e~60000\u003c/td\u003e\u003c/tr\u003e\n\u003c/table\u003e\n\nI've made it so that the tests use GMP if it's installed, or InfInt.h otherwise (since it's a single header file).\n\nFor C#, I use the built in BigInteger class, and for Python the built in integer class (it's handled by default)\n\nI also make a point of using the same implementation in all languages, since that's how new comers usually do.\nThey code the way they're used to if they don't know anything specific about the language.\n\nAlso, I don't try to optimize the examples too much, since that in real situations, you might not always have time to do that.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjcash%2Flanguagetests","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjcash%2Flanguagetests","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjcash%2Flanguagetests/lists"}