{"id":20616468,"url":"https://github.com/evanxg852000/gorilla","last_synced_at":"2026-04-21T06:33:33.541Z","repository":{"id":216941372,"uuid":"742748063","full_name":"evanxg852000/gorilla","owner":"evanxg852000","description":"Gorilla 🦍 is a port of the Facebook gorilla time-series data compression algorithm to Zig","archived":false,"fork":false,"pushed_at":"2024-01-13T18:41:18.000Z","size":18,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-17T04:32:32.108Z","etag":null,"topics":["compression-algorithm","time-series"],"latest_commit_sha":null,"homepage":"","language":"Zig","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/evanxg852000.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":"2024-01-13T08:45:25.000Z","updated_at":"2024-01-14T19:36:57.000Z","dependencies_parsed_at":null,"dependency_job_id":"1a79aae7-2e54-429e-80d9-87a542d8a9d0","html_url":"https://github.com/evanxg852000/gorilla","commit_stats":null,"previous_names":["evanxg852000/gorilla"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evanxg852000%2Fgorilla","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evanxg852000%2Fgorilla/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evanxg852000%2Fgorilla/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evanxg852000%2Fgorilla/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/evanxg852000","download_url":"https://codeload.github.com/evanxg852000/gorilla/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242269330,"owners_count":20100076,"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":["compression-algorithm","time-series"],"created_at":"2024-11-16T11:19:19.509Z","updated_at":"2026-04-21T06:33:28.523Z","avatar_url":"https://github.com/evanxg852000.png","language":"Zig","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Gorilla 🦍\n\nA port of the Facebook gorilla time-series data compression algorithm to Zig.\n\nℹ️ This was done as part of my time at [Recurse Center](https://www.recurse.com/).\n\n⚠️ Please, do not rely on this library for production work. It still needs to be thoroughly tested. You are also welcome to help.\n\n## How to use?\n\n```zig\nconst std = @import(\"std\");\nconst gorilla = @import(\"gorilla\");\n\nconst GorillaEncoder  = gorilla.GorillaEncoder;\nconst GorillaDecoder  = gorilla.GorillaDecoder;\nconst DataPoint = gorilla.DataPoint;\n\npub fn main() !void {\n    var gpa = std.heap.GeneralPurposeAllocator(.{}){};\n    defer _ = gpa.deinit();\n    const allocator = gpa.allocator();\n\n    const dataset = [_]DataPoint{\n        .{ .timestamp = 1482892270, .value = 1.76},\n        .{ .timestamp = 1482892280, .value = 7.78},\n        .{ .timestamp = 1482892288, .value = 7.95},\n        .{ .timestamp = 1482892292, .value = 5.53},\n        .{ .timestamp = 1482892310, .value = 4.41},\n        .{ .timestamp = 1482892323, .value = 5.30},\n        .{ .timestamp = 1482892334, .value = 5.30},\n        .{ .timestamp = 1482892341, .value = 2.92},\n        .{ .timestamp = 1482892350, .value = 0.73},\n        .{ .timestamp = 1482892360, .value = -1.33},\n        .{ .timestamp = 1482892390, .value = -12.45},\n        .{ .timestamp = 1482892390, .value = -12.45},\n        .{ .timestamp = 1482892401, .value = -34.76},\n        .{ .timestamp = 1482892490, .value = 78.9},\n        .{ .timestamp = 1482892500, .value = 335.67},\n        .{ .timestamp = 1482892800, .value = 12908.12},\n    };\n    \n    var encoder = try GorillaEncoder.init(allocator, 1482892270);\n    defer encoder.deinit();\n    for(dataset)|point| {\n        try encoder.encode(point);\n    }\n    const data = try encoder.finish();\n\n    var decoder = try GorillaDecoder.init(data[0], data[1]);\n    var actual_points = [_]DataPoint{ DataPoint{ .timestamp = 0, .value = 0 } } ** 16;\n    for(\u0026actual_points) |*dp| {\n        dp.* = (try decoder.next()).?;\n    }\n\n    const testing = @import(\"std\").testing;\n    try testing.expectEqual(@as(?DataPoint, null), (try decoder.next())); \n    try testing.expectEqualSlices(DataPoint, dataset[0..], actual_points[0..]); \n}\n```\n\n## Credits to the following resources.\n\n- [The Facebook gorilla paper](https://www.vldb.org/pvldb/vol8/p1816-teller.pdf)\n- [The reference implementation](https://github.com/facebookarchive/beringei)\n- [A golang implementation](https://github.com/keisku/gorilla)\n- [A rust implementation](https://github.com/jeromefroe/tsz-rs)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevanxg852000%2Fgorilla","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fevanxg852000%2Fgorilla","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevanxg852000%2Fgorilla/lists"}