{"id":17082011,"url":"https://github.com/studyzy/marshalcache","last_synced_at":"2025-08-07T14:44:17.818Z","repository":{"id":57626196,"uuid":"384185333","full_name":"studyzy/marshalcache","owner":"studyzy","description":"MarshalCache","archived":false,"fork":false,"pushed_at":"2021-09-15T03:42:23.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-28T19:33:45.490Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/studyzy.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}},"created_at":"2021-07-08T16:25:34.000Z","updated_at":"2021-09-15T03:41:59.000Z","dependencies_parsed_at":"2022-08-31T05:40:32.918Z","dependency_job_id":null,"html_url":"https://github.com/studyzy/marshalcache","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/studyzy%2Fmarshalcache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/studyzy%2Fmarshalcache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/studyzy%2Fmarshalcache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/studyzy%2Fmarshalcache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/studyzy","download_url":"https://codeload.github.com/studyzy/marshalcache/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245106464,"owners_count":20561715,"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":[],"created_at":"2024-10-14T12:58:44.172Z","updated_at":"2025-03-23T13:25:20.855Z","avatar_url":"https://github.com/studyzy.png","language":"Go","readme":"# marshalcache\nMarshalCache序列化反序列化缓存\n## 1.每个要缓存的对象提供方法：\n`GetMcKey() string`\n如果要序列化或者反序列化的对象没有这个实例方法，那么将无法应用缓存，而是直接调用对应的序列化反序列化方法。\n## 2.缓存的写入\n### 2.1Marshal的时候\nmc.Marshal(obj)\n只要满足GetMcKey接口的，那么获得Key，然后将序列化对象放入缓存\n### 2.2Unmarshal的时候\n如果Unmarshal的对象满足GetMcKey接口，那么就将传入的bytes放入缓存。\n## 3子对象缓存（高级特性）\n\n## 4性能测试结果\n以JSON序列化为例，使用MarshalCache后性能明显提高\n```\nBenchmarkMarshalCacheImpl_Marshal_Direct\nBenchmarkMarshalCacheImpl_Marshal_Direct-8     \t    3181\t    337121 ns/op\nBenchmarkMarshalCacheImpl_Marshal_UseCache\nBenchmarkMarshalCacheImpl_Marshal_UseCache-8   \t 6956326\t       169 ns/op\nBenchmarkMarshalCacheImpl_Marshal_NoCache\nBenchmarkMarshalCacheImpl_Marshal_NoCache-8    \t    3555\t    325300 ns/op\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstudyzy%2Fmarshalcache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstudyzy%2Fmarshalcache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstudyzy%2Fmarshalcache/lists"}