{"id":27719410,"url":"https://github.com/workbunny/pjson","last_synced_at":"2025-04-27T07:47:13.296Z","repository":{"id":288057954,"uuid":"966690271","full_name":"workbunny/pjson","owner":"workbunny","description":"✨ PJson 用于解析 JSON 数据并提供高效的内存管理优化。","archived":false,"fork":false,"pushed_at":"2025-04-26T10:01:59.000Z","size":473,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-04-27T07:47:03.695Z","etag":null,"topics":["json","php-ffi","php8"],"latest_commit_sha":null,"homepage":"","language":"C","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/workbunny.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,"zenodo":null}},"created_at":"2025-04-15T10:00:00.000Z","updated_at":"2025-04-24T01:18:06.000Z","dependencies_parsed_at":"2025-04-16T08:16:09.509Z","dependency_job_id":null,"html_url":"https://github.com/workbunny/pjson","commit_stats":null,"previous_names":["workbunny/pjson"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/workbunny%2Fpjson","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/workbunny%2Fpjson/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/workbunny%2Fpjson/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/workbunny%2Fpjson/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/workbunny","download_url":"https://codeload.github.com/workbunny/pjson/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251106450,"owners_count":21537168,"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":["json","php-ffi","php8"],"created_at":"2025-04-27T07:47:12.808Z","updated_at":"2025-04-27T07:47:13.281Z","avatar_url":"https://github.com/workbunny.png","language":"C","readme":"# pjson\n✨ PJson 用于解析 JSON 数据并提供高效的内存管理优化。\n\n## 依赖\n\n- PHP 8.1 或更高版本\n- Composer 2.0 或更高版本\n- PHP 扩展 `ffi` 已启用\n- linux 系统\n- windows 系统\n- mac 系统(暂未开启)\n\n## 安装\n\n```bash\n# 暂未开启\ncomposer require workbunny/pjson\n```\n\n## 如何使用\n\n[文档](doc/README.MD)\n\n## 测试对比结果\n\n\u003e 以此json为例 `https://geo.datav.aliyun.com/areas_v3/bound/100000.json`\n\nphp原生\n\n```php\n// 原生解析\n$php_json = json_decode($json_str, true);\n// 拿其中一个字段\n$type = $php_json['type'];\nvar_dump($type);\n```\n\n```\n当前内存占用: 2.25MB\n执行耗时: 0.0042 秒\n```\n\npjson\n\n```php\n// pjson解析\n$json = Json::parse_str($json_str);\n$type = Json::getStr($json, 'type');\nvar_dump($type);\n```\n\n```\n当前内存占用: 572.92KB\n执行耗时: 0.0137 秒\n```\n\n## 编译json动态库\n\n编译适合自己系统的动态库\n\n`build` 文件夹\n\n```bash\ngcc parson.c -shared -o Json.so -O2 -Wall -Wextra -std=c89 -pedantic-errors -DTESTS_MAIN \n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fworkbunny%2Fpjson","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fworkbunny%2Fpjson","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fworkbunny%2Fpjson/lists"}