{"id":26486619,"url":"https://github.com/chopikus/raytracing-bench","last_synced_at":"2026-05-06T08:34:07.388Z","repository":{"id":248760761,"uuid":"829621194","full_name":"chopikus/raytracing-bench","owner":"chopikus","description":"Benchmarking ray tracers in Python, Java, Numpy, Cupy, Pypy","archived":false,"fork":false,"pushed_at":"2024-08-11T12:49:51.000Z","size":403,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-08-11T15:28:16.538Z","etag":null,"topics":["cupy","java","numpy","pypy","python","raytracing"],"latest_commit_sha":null,"homepage":"","language":"Python","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/chopikus.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-07-16T19:59:56.000Z","updated_at":"2024-08-11T13:05:07.000Z","dependencies_parsed_at":"2024-08-10T15:28:00.536Z","dependency_job_id":"28e16f8e-ab1c-41c8-87c1-6b61fa52b3f0","html_url":"https://github.com/chopikus/raytracing-bench","commit_stats":null,"previous_names":["chopikus/raytracer"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chopikus%2Fraytracing-bench","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chopikus%2Fraytracing-bench/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chopikus%2Fraytracing-bench/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chopikus%2Fraytracing-bench/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chopikus","download_url":"https://codeload.github.com/chopikus/raytracing-bench/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244560868,"owners_count":20472305,"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":["cupy","java","numpy","pypy","python","raytracing"],"created_at":"2025-03-20T06:20:06.684Z","updated_at":"2026-05-06T08:34:02.365Z","avatar_url":"https://github.com/chopikus.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# raytracer\n\n(based on 'Raytracing in one weekend')\n\nWhile researching scientific programming libraries I ended up with a bunch of different implementations of the ray tracer in Java, Python, Numpy, Cupy.\n\nEvery rendering is done on CPU except for cupy implementation.\n\n## Benchmarking\n\n### Pic1\n\n![Rendered picture](https://github.com/chopikus/raytracer/blob/main/pic1.png)\n\nSize: 400x225, two spheres with 50% diffusion and red gradient background, rendered with 10 samples per pixel.\n\n### Pic2\n\n![Rendered picture](https://github.com/chopikus/raytracer/blob/main/pic2.png)\n\nSize: 400x225, one red sphere without diffusion, rendered with 10 samples per pixel.\n\n\n### Pic3\n\n![Rendered picture](https://github.com/chopikus/raytracer/blob/main/pic3.png)\n\nSize: 1000x562, one red sphere without diffusion, rendered with 240 samples per pixel.\n\n\n### Hardware, OS\n\nCPU: Xeon® E5-2620 v2\n\nGPU: GTX 1070\n\nRAM: 32Gb\n\nVM running Ubuntu 22.04\n\n`python3 --version`: `Python 3.10.12`\n\n`java -version`: `openjdk version \"21.0.4\" 2024-07-16, OpenJDK Runtime Environment (build 21.0.4+7-Ubuntu-1ubuntu222.04), OpenJDK 64-Bit Server VM (build 21.0.4+7-Ubuntu-1ubuntu222.04, mixed mode, sharing)`\n\n### Results\n\nRendering Pic1:\n\n|Implementation|Real Time|Result of `time` command   |Command   |Branch|\n|---|---|---|---|---|\n|Python|**42.393s**|`real\t0m42.393s user\t0m42.371s sys\t0m0.020s`   |`time (python3 src/main.py)`   |`main`|\n|Pypy|**2.382s**|`real\t0m2.382s user\t0m2.271s sys\t0m0.105s`   |`time (./pypy3.10-v7.3.16-linux64/bin/pypy3.10 raytracer/src/main.py)`   |`main`|\n|Java|**1.016s**|`real\t0m1.016s user\t0m1.694s sys\t0m0.323s`   |`time (java -jar target/raytracer-1.0-SNAPSHOT.jar)`   |`java-impl`|\n\nRendering Pic2:\n|Implementation|Real Time|Result of `time` command   |Command   |Branch|\n|---|---|---|---|---|\n|Python|**19.185s**|`real\t0m19.185s user\t0m20.224s sys\t0m0.052s`|`time (python3 src/main.py)`|`python-simple-impl`|\n|Pypy|**1.433s**|`real\t0m1.433s user\t0m1.305s sys\t0m0.128s`|`time (./pypy3.10-v7.3.16-linux64/bin/pypy3.10 raytracer/src/main.py)`|`python-simple-impl`|\n|Numpy|**1.331s**|`real\t0m1.331s user\t0m2.182s sys\t0m0.194s`|`time (python3 src/main.py)`|`speedup`|\n|Java|**0.552s**|`real\t0m0.552s user\t0m0.810s sys\t0m0.167s`|`time (java -jar target/raytracer-1.0-SNAPSHOT.jar)`|`java-simple-impl`|\n\nRendering Pic3:\n|Implementation|Real Time|Result of `time` command   |Command   |Branch|\n|---|---|---|---|---|\n|Python|**2641.102s**|`real\t44m1.102s user 44m1.853s sys\t0m0.137s`|`time (python3 src/main.py)`|`python-simple-impl`|\n|Pypy|**53.885s**|`real\t0m53.885s user\t0m53.670s sys\t0m0.212s`|`time (./pypy3.10-v7.3.16-linux64/bin/pypy3.10 raytracer/src/main.py)`|`python-simple-impl`|\n|Numpy|**48.923s**|`real\t0m48.923s user\t0m34.417s sys\t0m15.646s`|`time (python3 src/main.py)`|`speedup`|\n|Java|**18.256s**|`real\t0m18.256s user\t0m17.582s sys\t0m1.565s`|`time (java -jar target/raytracer-1.0-SNAPSHOT.jar)`|`java-simple-impl`|\n|Cupy (**On GPU**)|**2.658s**|`real\t0m2.658s user\t0m1.723s sys\t0m1.909s`|`time (python3 src/main.py)`|`cupy-speedup`|\n\n## Future\n\nTODO Benchmark rendering the same picture for all implementations.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchopikus%2Fraytracing-bench","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchopikus%2Fraytracing-bench","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchopikus%2Fraytracing-bench/lists"}