{"id":18426348,"url":"https://github.com/jordicorbilla/mapreduce","last_synced_at":"2025-08-18T01:34:24.618Z","repository":{"id":74791154,"uuid":"44489710","full_name":"JordiCorbilla/MapReduce","owner":"JordiCorbilla","description":"Data parallel text processing with MapReduce","archived":false,"fork":false,"pushed_at":"2020-11-11T19:21:58.000Z","size":18002,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-08-15T14:17:24.796Z","etag":null,"topics":["mapreduce","parallel-computing"],"latest_commit_sha":null,"homepage":"http://jordicorbilla.github.io/MapReduce/","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/JordiCorbilla.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":"2015-10-18T18:04:01.000Z","updated_at":"2022-04-13T08:37:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"1d1f53c6-5a4a-4910-ae9f-33b79f02d6d3","html_url":"https://github.com/JordiCorbilla/MapReduce","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/JordiCorbilla/MapReduce","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JordiCorbilla%2FMapReduce","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JordiCorbilla%2FMapReduce/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JordiCorbilla%2FMapReduce/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JordiCorbilla%2FMapReduce/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JordiCorbilla","download_url":"https://codeload.github.com/JordiCorbilla/MapReduce/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JordiCorbilla%2FMapReduce/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270932577,"owners_count":24670240,"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","status":"online","status_checked_at":"2025-08-17T02:00:09.016Z","response_time":129,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["mapreduce","parallel-computing"],"created_at":"2024-11-06T05:07:43.818Z","updated_at":"2025-08-18T01:34:24.610Z","avatar_url":"https://github.com/JordiCorbilla.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MapReduce\n**Data parallel text processing with MapReduce.**\n\n![](https://img.shields.io/badge/license-MIT-red.svg) ![](https://img.shields.io/badge/NET-4.8-red.svg)\n\nThis is one my solution for this common problem using MapReduce.\nThe best way to process any task is to split it in several chunks and divide the work amongst several **'workers'** in a distributed way and then compose the results in a later stage. \n\nFor this problem I am using **MapReduce approach** using **LINQ** and **.NET 4.8**.\n\nProcessing the file sequentially and keeping the results in a **dictionary \u003ckey, value\u003e** is an easy task but with a really bad performance. Using MapReduce strategy we could split the work and then combine the results in a concurrent dictionary:\n\n![](http://3.bp.blogspot.com/-kp8P4JNTZGs/Vf6rVGiuweI/AAAAAAAAFHk/uwvz_faeJjY/s640/examplemapreduce.png)\n\n![](https://3.bp.blogspot.com/-I1VeJ2WgIpI/V0wHmC0c3TI/AAAAAAAAFeU/J35AcpRlL_EM9eleNGVJwUQmeWs6vE7fQCLcB/s1600/aa2.png)\n\n*Nuget Package:*\nYou can download this package from Nuget in your VS solution.\nhttps://www.nuget.org/packages/Thundax.MapReduce.dll/\n\n*Example usage:*\n```C#\nusing Thundax.MapReduce;\n\nReducer reducer = new Reducer();\ntry\n{\n    string readText = File.ReadAllText(args[0]);\n    Console.WriteLine(\"Starting reduction\");\n    reducer.MapReduce(readText);\n    Console.WriteLine(\"Reduction completed\");\n    File.WriteAllText(\"Results.txt\", reducer.SortedResults().ToString());\n    Console.WriteLine(\"Done!, processing {0:D} words\", reducer.Numwords);\n    Console.WriteLine(\"Please review Results.txt\");\n\n}\ncatch (Exception ex)\n{\n    Console.WriteLine(ex.Message);                \n}\n```\n\n**Benchmark testing:**\n\n- This solution can count 500k workds in 400ms using 1 processor with 4 cores.\n- Download the version 1.0 from here. https://app.box.com/s/jfh684sgqtp0it856fvcv6186sssn3m3\n- or via Nuget https://www.nuget.org/packages/Thundax.MapReduce.dll/\n\n**Licence**\n-------\n\n    The MIT License (MIT)\n    \n    Copyright (c) 2015 Jordi Corbilla\n    \n    Permission is hereby granted, free of charge, to any person obtaining a copy\n    of this software and associated documentation files (the \"Software\"), to deal\n    in the Software without restriction, including without limitation the rights\n    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n    copies of the Software, and to permit persons to whom the Software is\n    furnished to do so, subject to the following conditions:\n    \n    The above copyright notice and this permission notice shall be included in\n    all copies or substantial portions of the Software.\n    \n    THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n    THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjordicorbilla%2Fmapreduce","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjordicorbilla%2Fmapreduce","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjordicorbilla%2Fmapreduce/lists"}