{"id":16179782,"url":"https://github.com/bep/gojap","last_synced_at":"2025-10-16T22:06:09.664Z","repository":{"id":65134370,"uuid":"582591201","full_name":"bep/gojap","owner":"bep","description":"This is a small library that wraps goja and adds a VM pool and compilation cache.","archived":false,"fork":false,"pushed_at":"2023-08-17T08:47:15.000Z","size":16,"stargazers_count":31,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-28T13:48:48.761Z","etag":null,"topics":["goja","golang","javascript"],"latest_commit_sha":null,"homepage":"","language":"Go","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/bep.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":["bep"]}},"created_at":"2022-12-27T09:52:54.000Z","updated_at":"2025-02-11T21:31:36.000Z","dependencies_parsed_at":"2024-06-20T02:56:55.465Z","dependency_job_id":null,"html_url":"https://github.com/bep/gojap","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":"bep/golibtemplate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bep%2Fgojap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bep%2Fgojap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bep%2Fgojap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bep%2Fgojap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bep","download_url":"https://codeload.github.com/bep/gojap/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243960361,"owners_count":20375102,"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":["goja","golang","javascript"],"created_at":"2024-10-10T05:44:00.366Z","updated_at":"2025-10-16T22:06:04.592Z","avatar_url":"https://github.com/bep.png","language":"Go","funding_links":["https://github.com/sponsors/bep"],"categories":["Go"],"sub_categories":[],"readme":"[![Tests on Linux, MacOS and Windows](https://github.com/bep/gojap/workflows/Test/badge.svg)](https://github.com/bep/gojap/actions?query=workflow:Test)\n[![Go Report Card](https://goreportcard.com/badge/github.com/bep/gojap)](https://goreportcard.com/report/github.com/bep/gojap)\n[![GoDoc](https://godoc.org/github.com/bep/gojap?status.svg)](https://godoc.org/github.com/bep/gojap)\n\n- [Baseline benchmarks with new VM per execution and no compile cache](#baseline-benchmarks-with-new-vm-per-execution-and-no-compile-cache)\n- [Benchmarks using a compilation cache and VM pool](#benchmarks-using-a-compilation-cache-and-vm-pool)\n\nThis is a small library that wraps [goja](https://github.com/dop251/goja/) and adds a VM pool and compilation cache. The primary intended use case for this is fast execution of a small set of small JavaScript programs with lots of different data contexts.\n\n## Baseline benchmarks with new VM per execution and no compile cache\n\n```\nBenchmark branch \"main\"\n\n go version go1.19.3 darwin/arm64\n\ngoos: darwin\ngoarch: arm64\npkg: github.com/bep/gojap\nBenchmarkRunString/no_args/Baseline/serial-10  \t    8080\t    146926 ns/op\t  292696 B/op\t    3629 allocs/op\nBenchmarkRunString/no_args/Baseline/parallel-10         \t    7945\t    147632 ns/op\t  292705 B/op\t    3629 allocs/op\nBenchmarkRunString/one_arg/Baseline/serial-10           \t    7335\t    152738 ns/op\t  292696 B/op\t    3629 allocs/op\nBenchmarkRunString/one_arg/Baseline/parallel-10         \t    7830\t    146396 ns/op\t  292697 B/op\t    3629 allocs/op\nBenchmarkRunString/big_script/Baseline/serial-10        \t    1453\t    807831 ns/op\t  392055 B/op\t    5219 allocs/op\nBenchmarkRunString/big_script/Baseline/parallel-10      \t    4455\t    266412 ns/op\t  392035 B/op\t    5219 allocs/op\nPASS\nok  \tgithub.com/bep/gojap\t8.238s\n\n\nname                                       time/op\nRunString/no_args/Baseline/serial-10       147µs ± 0%\nRunString/no_args/Baseline/parallel-10     148µs ± 0%\nRunString/one_arg/Baseline/serial-10       153µs ± 0%\nRunString/one_arg/Baseline/parallel-10     146µs ± 0%\nRunString/big_script/Baseline/serial-10    808µs ± 0%\nRunString/big_script/Baseline/parallel-10  266µs ± 0%\n\nname                                       alloc/op\nRunString/no_args/Baseline/serial-10       293kB ± 0%\nRunString/no_args/Baseline/parallel-10     293kB ± 0%\nRunString/one_arg/Baseline/serial-10       293kB ± 0%\nRunString/one_arg/Baseline/parallel-10     293kB ± 0%\nRunString/big_script/Baseline/serial-10    392kB ± 0%\nRunString/big_script/Baseline/parallel-10  392kB ± 0%\n\nname                                       allocs/op\nRunString/no_args/Baseline/serial-10       3.63k ± 0%\nRunString/no_args/Baseline/parallel-10     3.63k ± 0%\nRunString/one_arg/Baseline/serial-10       3.63k ± 0%\nRunString/one_arg/Baseline/parallel-10     3.63k ± 0%\nRunString/big_script/Baseline/serial-10    5.22k ± 0%\nRunString/big_script/Baseline/parallel-10  5.22k ± 0%\n```\n\n## Benchmarks using a compilation cache and VM pool\n\n```\n go version go1.19.3 darwin/arm64\n\ngoos: darwin\ngoarch: arm64\npkg: github.com/bep/gojap\nBenchmarkRunString/no_args/Cached/serial-10         \t13894812\t        74.72 ns/op\t      32 B/op\t       1 allocs/op\nBenchmarkRunString/no_args/Cached/parallel-10       \t 8473996\t       141.2 ns/op\t      38 B/op\t       1 allocs/op\nBenchmarkRunString/one_arg/Cached/serial-10         \t 5172565\t       226.8 ns/op\t      32 B/op\t       1 allocs/op\nBenchmarkRunString/one_arg/Cached/parallel-10       \t 7516302\t       161.8 ns/op\t      37 B/op\t       1 allocs/op\nBenchmarkRunString/big_script/Cached/serial-10      \t   99742\t     11929 ns/op\t    2323 B/op\t     280 allocs/op\nBenchmarkRunString/big_script/Cached/parallel-10    \t  420262\t      2557 ns/op\t    2332 B/op\t     280 allocs/op\nPASS\nok  \tgithub.com/bep/gojap\t7.840s\n\n\nname                                     time/op\nRunString/no_args/Cached/serial-10       74.7ns ± 0%\nRunString/no_args/Cached/parallel-10      141ns ± 0%\nRunString/one_arg/Cached/serial-10        227ns ± 0%\nRunString/one_arg/Cached/parallel-10      162ns ± 0%\nRunString/big_script/Cached/serial-10    11.9µs ± 0%\nRunString/big_script/Cached/parallel-10  2.56µs ± 0%\n\nname                                     alloc/op\nRunString/no_args/Cached/serial-10        32.0B ± 0%\nRunString/no_args/Cached/parallel-10      38.0B ± 0%\nRunString/one_arg/Cached/serial-10        32.0B ± 0%\nRunString/one_arg/Cached/parallel-10      37.0B ± 0%\nRunString/big_script/Cached/serial-10    2.32kB ± 0%\nRunString/big_script/Cached/parallel-10  2.33kB ± 0%\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbep%2Fgojap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbep%2Fgojap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbep%2Fgojap/lists"}