{"id":15083918,"url":"https://github.com/nxy7/deno-nushell-benchmark","last_synced_at":"2026-01-04T03:10:57.004Z","repository":{"id":251974901,"uuid":"838976270","full_name":"nxy7/deno-nushell-benchmark","owner":"nxy7","description":"Deno vs Nushell benchmark (1 million rows)","archived":false,"fork":false,"pushed_at":"2024-08-06T19:57:52.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-14T01:36:08.476Z","etag":null,"topics":["1million-rows","benchmark","deno","nu","nushell"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/nxy7.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}},"created_at":"2024-08-06T18:02:00.000Z","updated_at":"2024-08-06T20:41:18.000Z","dependencies_parsed_at":"2024-08-08T00:21:18.506Z","dependency_job_id":null,"html_url":"https://github.com/nxy7/deno-nushell-benchmark","commit_stats":{"total_commits":2,"total_committers":1,"mean_commits":2.0,"dds":0.0,"last_synced_commit":"4921ce3fdb98d7eb06c3fc8a9c5dc5c71d5761c5"},"previous_names":["nxy7/deno-nushell-benchmark"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nxy7%2Fdeno-nushell-benchmark","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nxy7%2Fdeno-nushell-benchmark/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nxy7%2Fdeno-nushell-benchmark/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nxy7%2Fdeno-nushell-benchmark/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nxy7","download_url":"https://codeload.github.com/nxy7/deno-nushell-benchmark/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243955715,"owners_count":20374372,"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":["1million-rows","benchmark","deno","nu","nushell"],"created_at":"2024-09-25T07:00:23.700Z","updated_at":"2026-01-04T03:10:56.977Z","avatar_url":"https://github.com/nxy7.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Deno vs Nushell\n\n## Motivation\n\nWhy would anyone benchmark Deno against Nushell? My thesis is that Deno could be great for shell scripts, you have\nwhole JS ecosystem to use without it's complexities. You don't need package.json, you don't need eslint/prettier.\nJust write `myScript.ts` file with shebang at the top and you've got yourself a pretty nice script.\nThis ease of use is very nice and I appreciate Deno std library which is quiet extensive.\n\nNushell is shell for new era, that unlike bash works with objects instead of strings. I like some things about nushell and\ndislike others. I'm daily driving it for a long time and it's language doesn't feel very intuitive to me. I kind of wish they\nmade it more TS-like so it would be more familiar (like use () brackets instead of []). It's somewhere between rust and TS it's also\nit's own thing which is a bit awkward. I think the Nu language is my least liked thing about the shell, other than that it's pretty good.\n\n# Benchmarks\n\nI've prepared just two benchmarks. One is regular old fibbonaci sequence calculation using recursion. Nushell has some limit on recursion (50 depth),\nso I've only calculated fib(25).\n\nThe other benchmark is more interesting. It's calculating temperature averages for 1 milion CSV rows distributed between five cities. Pretty similar\nto `1 billion rows challenge` but at smaller scale. I'm generating the CSV with another script, and then calculating averages.\n\nBoth benchmarks were ran 5 times.\n\n## Fibbonaci sequence\n\nNushell results:\n```\n            Mean        Std.Dev.    Min         Median      Max\nreal        0.361       0.016       0.344       0.355       0.381       \nuser        0.351       0.016       0.335       0.342       0.373       \nsys         0.008       0.001       0.006       0.007       0.010       \nmaxrss      29469       221         29144       29580       29724       \nminflt      3204        8           3193        3207        3216        \n```\n\nDeno results:\n```\n            Mean        Std.Dev.    Min         Median      Max\nreal        0.022       0.003       0.018       0.022       0.026       \nuser        0.010       0.001       0.009       0.010       0.011       \nsys         0.012       0.001       0.011       0.011       0.014       \nmaxrss      54950       224         54644       54936       55272       \nminflt      3756        1           3754        3757        3758        \n```\n\nDeno was 16 times faster and used 2x times more memory than Nushell.\n\n## 1 milion rows\n\nNu output:\n```\n╭───┬─────────────┬───────╮\n│ # │    city     │  avg  │\n├───┼─────────────┼───────┤\n│ 0 │ Houston     │ 10.03 │\n│ 1 │ Phoenix     │  9.93 │\n│ 2 │ New York    │  9.93 │\n│ 3 │ Chicago     │  9.98 │\n│ 4 │ Los Angeles │  9.96 │\n╰───┴─────────────┴───────╯\n```\n\nNushell results:\n```\n            Mean        Std.Dev.    Min         Median      Max\nreal        0.942       0.032       0.900       0.932       0.997       \nuser        0.732       0.024       0.706       0.729       0.774       \nsys         0.205       0.009       0.191       0.203       0.217       \nmaxrss      527409      350         526948      527660      527740      \nminflt      146785      383         146588      146595      147553      \n```\n\nDeno output:\n```\n[\n  { city: \"Houston\", avgTemperature: 10.033709541204631 },\n  { city: \"Phoenix\", avgTemperature: 9.932006789287124 },\n  { city: \"New York\", avgTemperature: 9.933804987573572 },\n  { city: \"Chicago\", avgTemperature: 9.97538478917931 },\n  { city: \"Los Angeles\", avgTemperature: 9.956839679748104 }\n]\n```\n\nDeno results:\n```\n            Mean        Std.Dev.    Min         Median      Max\nreal        1.861       0.020       1.839       1.851       1.896       \nuser        2.085       0.022       2.058       2.080       2.123       \nsys         0.166       0.008       0.159       0.164       0.181       \nmaxrss      168441      1640        166988      167492      171448      \nminflt      35775       237         35464       35714       36180       \n```\n\nNushell was over 2 times faster and used much more memory (~3x times more). \n\n# Results\n\n## Performance\n\nI suspect that nushell uses rust under the shell to make data aggregation quick, and raw nushell scripts are pretty slow.\nThat would expect why nushell crushed Deno in `1 million rows` but lost in `fibbonaci` test. This is fine, shell doesn't have\nto be fast and I think it's great that Nushell is fast enough for scripts, but really quick for calculations on big data sets.\n\nI expected Deno to win both tests (after all Nushell is much smaller project), but as I said probably I wasn't benchmarking \nDeno vs Nushell, but Deno vs some rust library that Nushell uses internally. I suspect that fibonacci test was benchmarking\nboth runtimes more 'fairly' (after all I could also use polars bindings or something else in Deno to achieve probably similar results).\n\nMaybe it's possible to optimize my TS code (that's very likely in fact), but I wanted to go for the easiest approach since I've wanted\nto test how both solutions will behave with idiomatic and easy to understand code.  \n\n## Ergonomics\n\nThis is probably more important thing. Have a look into rows.nu and rows.ts files to see difference between both languages. Nushell was\nmore consise and after figuring out some quirks (like being forced to use `items` function) it turned out great. I hate that I've spent\nover 10 minutes fighting against wrong bracket types, trying to return tuples etc. etc. but that was skill issue on my part. Probably\nif I'd spend some time in the ecosystem those things would become muscle memory, but I'd prefer more familiar syntax, but maybe there are reasons\nto not follow RS/TS more closely. \n\nDeno was just Typescript with it's strengths and weaknesses. Nushell functional approach with pipes was better for data manipulation, but\nif something needs to be done imperatively I'd much rather use TS. \n\n# Summary\n\nIn the future I'll probably reach to use nushell whenever I'd need to inspect some big CSVs and manipulate them, but even when Nushell\nget's their package management system I don't think I'd reach for it for imperative tasks. Here are some examples of tasks with my preferred choice:\n\n- Data aggregation / manipulation - Nushell\n- Simple automation (think about just running bunch of commands) - Nushell\n- Long running automation (maybe something with CRON etc.) - Deno\n- CLIs - Nushell (didn't touch on that, but nushell does that out of the box)\n- Web Scraping - Deno\n- Anything with more involved logic - Deno\n- Anything that's solved problem in JS Land - Deno\n\nAll in all I don't think performance matters here, have a look at source code to see solutions in both languages and which ones looks better.\nErgonomics are more important in such use cases and I think that there's no winner in this category and I'll my tools depending on the job.\n\nCheers.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnxy7%2Fdeno-nushell-benchmark","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnxy7%2Fdeno-nushell-benchmark","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnxy7%2Fdeno-nushell-benchmark/lists"}