{"id":15984673,"url":"https://github.com/aappddeevv/scalajs-packagingtest","last_synced_at":"2025-09-24T01:39:34.176Z","repository":{"id":97610133,"uuid":"122886620","full_name":"aappddeevv/scalajs-packagingtest","owner":"aappddeevv","description":"Test scala.js package sizes","archived":false,"fork":false,"pushed_at":"2018-02-28T01:31:25.000Z","size":16,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-24T01:39:32.690Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Scala","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/aappddeevv.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":"2018-02-25T23:10:57.000Z","updated_at":"2018-02-26T01:33:46.000Z","dependencies_parsed_at":"2023-04-06T08:36:42.628Z","dependency_job_id":null,"html_url":"https://github.com/aappddeevv/scalajs-packagingtest","commit_stats":{"total_commits":8,"total_committers":1,"mean_commits":8.0,"dds":0.0,"last_synced_commit":"4d74d27af469957872d12e7560bbf817cd487ac1"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/aappddeevv/scalajs-packagingtest","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aappddeevv%2Fscalajs-packagingtest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aappddeevv%2Fscalajs-packagingtest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aappddeevv%2Fscalajs-packagingtest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aappddeevv%2Fscalajs-packagingtest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aappddeevv","download_url":"https://codeload.github.com/aappddeevv/scalajs-packagingtest/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aappddeevv%2Fscalajs-packagingtest/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276678837,"owners_count":25684803,"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-09-23T02:00:09.130Z","response_time":73,"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":[],"created_at":"2024-10-08T02:10:04.147Z","updated_at":"2025-09-24T01:39:34.120Z","avatar_url":"https://github.com/aappddeevv.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Packaging Size Testing\n\nTest packaging sizes based on including various aspects of the scala langugage or external libraries.\n\nTo run a test, it is also necessary to sometimes perform a small trivial computation in order to ensure that the code is not removed during dead-code elimination phases.\n\nOnly fullOptJS compiles count. fastOptJS is not used in production and is significantly larger of course.\n\nA main def is defined in each test so that there is an entry point defined although this is not essential. Measurements are in bytes unless otherwise noted.\n\n## Results\n\n| Test   | Comment |fullOptJS (0.6.X)| fullOptJS (1.0.0-M3)|\n|------- |-----------|-----:|----:|\n| test0 | no main (despite comment above) | 9,255 | 8,838 |\n| test1  | no code except main | 9,485 | 9,025 |\n| test2  | a single native trait | 9,486 | 9,025|\n| test3  | non-native traits, with new | 9,486 | 9,025|\n| test4  | println of some strings with s/f | 44,423 | 38,641 |\n| test5  | Immutable HashMap only | 42,988 | 40,539 |\n| test6 | Immutable HashMap and printf | 65,365 | 58,689 |\n| test7 | Immutable HashMap, Seq | 88,837 | 81,205 |\n| test8 | Immutable HashMap, Seq, HashSet | 97,165 | 89,303|\n| test9 | Create js array, literals, js.Dicts | 9,493 | 9,031 |\n| test10 | 2 case class, no main (1 case class is the same size!) | 9,256 ?? | 8,839 |\n| test11 | js Promise+scala future (just Promise) | 66,033 (9,514) | 66,034 (9,514) |\n\nNotes:\n* println adds a lot of kb.\n* Each immutable structure seems to add around 10-20K.\n* Zipped sizes are small. test0 =\u003e 3,625 (3,480), test8 =\u003e 23,459 (21,950).\n\nIt's pretty clear, and validates our expectations, that the scala.js overhead is\nreally due to the parts that can get pulled in rather than scala.js itself. If\nyou use existing scala.js libraries, then you most likely pull in alot of the\noverhead parts of the standard scala library.\n\nUsing futures, println, immutable data structures appears to add around ~150kb\n(eyeball) to the fullOptJS module size.\n\n## Sizes of JS Related Libraries\n\nSome of these have dependencies that are not reflected directly in their byte\ncount but some do! Some sizes were checked via npm installing and some via cdn.\n\n| JS Library | Comment | size (min or non-min) |\n|-------------|---------|--------|\n| ramda | functional lib| 44,743 |\n| immutable-js | immutable data structures | 56,904 |\n| monet | some monads | 27,665 (non-min) |\n| sprintf   | printf-like | 13,565 |\n| office-fabric-ui-react | UI component | 801,429 |\n\nIf you add most of a UI component library, the scala.js overhead is a small % of\nthe total bundle size. Most effort should be put into reducing the bundling of\nun-needed UI components.\n\nAltogether, non-UI, minimized code size is around ~140kb (eyeball) for\nequivalent parts in scala so *if* you include those parts, its about the same\noverall. non-scala.js code allows you to more cleverly carve up your kb\nbudget. Also, if you have a mixed project, it's additive.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faappddeevv%2Fscalajs-packagingtest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faappddeevv%2Fscalajs-packagingtest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faappddeevv%2Fscalajs-packagingtest/lists"}