{"id":29821960,"url":"https://github.com/nagasaki45/how-to-make-cpp-faster","last_synced_at":"2026-05-18T06:40:07.537Z","repository":{"id":77434260,"uuid":"80253568","full_name":"Nagasaki45/how-to-make-cpp-faster","owner":"Nagasaki45","description":"(than python)","archived":false,"fork":false,"pushed_at":"2017-07-19T13:15:21.000Z","size":10,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-29T00:24:13.336Z","etag":null,"topics":["cpp","performance","python"],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Nagasaki45.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null}},"created_at":"2017-01-27T23:04:48.000Z","updated_at":"2017-07-24T11:15:53.000Z","dependencies_parsed_at":"2023-10-26T22:00:25.613Z","dependency_job_id":null,"html_url":"https://github.com/Nagasaki45/how-to-make-cpp-faster","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Nagasaki45/how-to-make-cpp-faster","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nagasaki45%2Fhow-to-make-cpp-faster","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nagasaki45%2Fhow-to-make-cpp-faster/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nagasaki45%2Fhow-to-make-cpp-faster/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nagasaki45%2Fhow-to-make-cpp-faster/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Nagasaki45","download_url":"https://codeload.github.com/Nagasaki45/how-to-make-cpp-faster/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nagasaki45%2Fhow-to-make-cpp-faster/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33167953,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-18T05:43:36.989Z","status":"ssl_error","status_checked_at":"2026-05-18T05:43:19.133Z","response_time":71,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["cpp","performance","python"],"created_at":"2025-07-29T00:13:18.773Z","updated_at":"2026-05-18T06:40:07.532Z","avatar_url":"https://github.com/Nagasaki45.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# How to make C++ faster than python\n\n*I have no idea...*\n\nYou heard that right. This repo propuses two two challanges:\n\n1. Try to write C++ algorithms that are faster than python.\n1. Try to write these algorithms in a way that the speed ratio between the C++ and the python implementations (the speedup) will be greater than the lines of code (LOC) ratio between them.\n\n## \"What???\"\n\nDon't underestimate python, and don't think that implementing an algorithms in python means writing a lot of slow `for` loops.\nThe scientific ecosystem around python is huge and relatively easy to use.\nOptimizing python code by vecotizing it with [numpy](http://www.numpy.org/) or [pandas](http://pandas.pydata.org/), or JIT compiling it with [numba](http://numba.pydata.org/) will drastically improve performance, and these are only few of the available options.\n\nSome execution time results\n\n                        time\n                        mean\n    exercise extention           \n    ex1      .cpp       17.929961\n             .py         3.093354\n    ex2      .cpp       45.230240\n             .py        49.245274\n    ex3      .cpp       27.230966\n             .py         1.183992\n\n\n## \"But this is not python\"\n\nYes it is! That's true that your code will start to call lower level routines in lower level and faster languages. But as a user, who cares?\n\n## Some context\n\nI'm taking a \"Parallel Computing with C++\" module this term.\nJust for the exercise I tried to code some of the examples in python, only to find out that with minor and simple optimizations, and by choosing the right tools for the job, I'm getting much better performance than with C++.\nBut I want to improve.\nI want to be able to write C++ code that will beat python in performace.\nThis is the main porpuse of this repo.\nWish me luck :-)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnagasaki45%2Fhow-to-make-cpp-faster","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnagasaki45%2Fhow-to-make-cpp-faster","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnagasaki45%2Fhow-to-make-cpp-faster/lists"}