{"id":20501356,"url":"https://github.com/scottpchow23/rust_showcase","last_synced_at":"2025-03-05T19:45:00.617Z","repository":{"id":124459262,"uuid":"256599856","full_name":"scottpchow23/rust_showcase","owner":"scottpchow23","description":"A introduction to Rust, as seen by two grad students from UCSB","archived":false,"fork":false,"pushed_at":"2020-06-07T19:22:09.000Z","size":199,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-16T07:12:59.679Z","etag":null,"topics":["benchmarks","documentation","profile","rust"],"latest_commit_sha":null,"homepage":"","language":"HTML","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/scottpchow23.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":"2020-04-17T20:10:54.000Z","updated_at":"2020-06-07T19:23:29.000Z","dependencies_parsed_at":"2023-08-07T19:35:50.434Z","dependency_job_id":null,"html_url":"https://github.com/scottpchow23/rust_showcase","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/scottpchow23%2Frust_showcase","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scottpchow23%2Frust_showcase/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scottpchow23%2Frust_showcase/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scottpchow23%2Frust_showcase/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scottpchow23","download_url":"https://codeload.github.com/scottpchow23/rust_showcase/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242097386,"owners_count":20071251,"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":["benchmarks","documentation","profile","rust"],"created_at":"2024-11-15T18:24:50.470Z","updated_at":"2025-03-05T19:45:00.577Z","avatar_url":"https://github.com/scottpchow23.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rust showcase\n\n## the main program\n\nThe main program is a simple API fetcher; it retrieves the list of classes for Spring quarter 2020 from UCSB's [curriculumn api](https://developer.ucsb.edu/content/academic-curriculums) and serializes the results to the a file named `classes.json` in the root director of the project.\n\n### setup\n\nYou'll need an API key from the UCSB API with the instructions [here](./docs/setup/README.md).\n\nAssuming that is done and you have the rust toolchain installed (instructions [here](https://www.rust-lang.org/tools/install)), you can run the project with `cargo run`.\n\n### points of interest\n\n- A performance profile is created throughout the runtime of the program using the `flame` crate; the profile can be found in `flame-graph.html` after running the main program at least once.\n- The classes can be retrieved in both a single and multi-threaded manner; both are profiled for comparison in the main file.\n  - _Note:_ there is a difference in the latency of the first request as compared to all other requests; this is likely a result of the underlying use of TCP, which requires time to \"warm up.\"\n\n## examples\n\nThere are a few example programs in this repo that are used to illustrate concepts written about in [docs](./docs). You can get a list of examples to run by running:\n\n```bash\ncargo run --example\n```\n\n## feature documentation\n\nHere is a list of features that we've looked into:\n\n- [Shadowing](./docs/shadowing.md)\n- [Ownership](./docs/ownership.md)\n- [Types](./docs/types.md)\n- [Channels](./docs/channels.md)\n- [Debugging](./docs/debugging.md)\n- [Profiling](./docs/profiling.md)\n\n## benchmarking\n\n### setup\n\nIn order to run the benchmark tests, you'll need to install the rust nightly toolchain.\n\nIf you don't already have rustup, the toolchain manager for rust, follow the instructions [here](https://rustup.rs/).\n\n```bash\n# Install nightly\nrustup toolchain install nightly\n```\n\nYou can run the benchmarks with\n\n```bash\nrustup run nightly cargo bench\n```\n\n### setting up benchmarks\n\n- If you want benchmark tests, they are currently a nightly/unstable feature.\n- If you want to use an unstable feature, you'll need to declare the flag at the top of the root file in your project (like line 1 of `main.rs` in this example).\n- You then need to stick all of your tests in a module, and flag that for testing with `#[cfg(test)]`.\n- Then flag all benchmarks with `#[bench]`.\n\n### common benchmark pitfall\n\nThe Rust compiler is smart, and sometimes this can work against you if you're attempting to test the performance of something. See [this link](https://doc.rust-lang.org/1.12.1/book/benchmark-tests.html#gotcha-optimizations) for details on the common pitfall with regards to benchmarking performance.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscottpchow23%2Frust_showcase","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscottpchow23%2Frust_showcase","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscottpchow23%2Frust_showcase/lists"}