Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use a concrete struct while parsing JSON to reduce memory consumption. (
#153) * Use a concrete struct while parsing json to reduce memory consuption. The npm package json can be very large. Using the `map[string]interface{}` results in the entire json data structure being deserialized. This costs a lot of memory and cpu time. The feed parser only needs the "time" portion of the json data, so by restricting the struct to that data we avoid a lot of overhead. Testing shows memory peaks close to 70Mb with this fix, rather than the 512Mb+ previously. * Values in the time map can be either string, or a struct, so use the empty interface.
- Loading branch information