{"id":13837788,"url":"https://github.com/leandromoreira/lua-resty-perf","last_synced_at":"2025-10-04T00:31:33.183Z","repository":{"id":141425686,"uuid":"357378633","full_name":"leandromoreira/lua-resty-perf","owner":"leandromoreira","description":"A small ngx resty lua library to benchmark memory and throughput of a function.","archived":false,"fork":false,"pushed_at":"2021-07-03T02:29:03.000Z","size":49,"stargazers_count":16,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-02-17T13:33:53.999Z","etag":null,"topics":["benchmark","cpu","lua","luajit","memory","nginx","openresty","performance","profiling"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/leandromoreira.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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}},"created_at":"2021-04-13T00:38:16.000Z","updated_at":"2024-05-30T08:04:27.993Z","dependencies_parsed_at":"2023-04-06T21:59:49.724Z","dependency_job_id":null,"html_url":"https://github.com/leandromoreira/lua-resty-perf","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/leandromoreira/lua-resty-perf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leandromoreira%2Flua-resty-perf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leandromoreira%2Flua-resty-perf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leandromoreira%2Flua-resty-perf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leandromoreira%2Flua-resty-perf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leandromoreira","download_url":"https://codeload.github.com/leandromoreira/lua-resty-perf/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leandromoreira%2Flua-resty-perf/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278249326,"owners_count":25955834,"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-10-03T02:00:06.070Z","response_time":53,"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":["benchmark","cpu","lua","luajit","memory","nginx","openresty","performance","profiling"],"created_at":"2024-08-04T15:01:25.155Z","updated_at":"2025-10-04T00:31:32.932Z","avatar_url":"https://github.com/leandromoreira.png","language":"Lua","funding_links":[],"categories":["Lua"],"sub_categories":[],"readme":"# Resty Perf\n\nA simple resty lua library to benchmark memory and throughput of a function.\n\n```lua\nlocal function mycode()\n  local x = {}\n  for i = 1, 1e3 do\n    local now = ngx.now()\n    now = now - 45 + i\n    x[i] = now\n  end\n  return x\nend\n\nperf.perf_time(\"mycode cpu profiling\", mycode)\n\nperf.perf_mem(\"mycode memory profiling\", mycode)\n```\nTo run it, you can use the openresty docker image:\n\n```bash\ndocker run -it --rm -v ${PWD}/test.lua:/test.lua -v ${PWD}/lib/resty/perf.lua:/lib/resty/perf.lua openresty/openresty:xenial resty /test.lua\n```\n\n![perf command line result](example.jpg \"A graph with experiments results\")\n\n# Installing\n\nThe module is available at [luarocks.](https://luarocks.org/modules/leandro/lua-resty-perf)\n\n```bash\nluarocks install lua-resty-perf\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleandromoreira%2Flua-resty-perf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleandromoreira%2Flua-resty-perf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleandromoreira%2Flua-resty-perf/lists"}