Skip to content

Commit

Permalink
fix: lru_cache on snapshot reads (#629)
Browse files Browse the repository at this point in the history
  • Loading branch information
noahnu authored and Noah Negin-Ulster committed Nov 24, 2022
1 parent 18c67eb commit fc19e85
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/syrupy/extensions/amber/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,10 @@ def _file_extension(self) -> str:
def _read_snapshot_fossil(self, snapshot_location: str) -> "SnapshotFossil":
return DataSerializer.read_file(snapshot_location)

@staticmethod
@lru_cache()
def __cacheable_read_snapshot(
self, snapshot_location: str, cache_key: str
snapshot_location: str, cache_key: str
) -> "SnapshotFossil":
return DataSerializer.read_file(snapshot_location)

Expand Down

2 comments on commit fc19e85

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark

Benchmark suite Current: fc19e85 Previous: d6906de Ratio
benchmarks/test_1000x.py::test_1000x_reads 0.607773711964517 iter/sec (stddev: 0.050465727530703546) 0.6503630428091709 iter/sec (stddev: 0.09295590401749011) 1.07
benchmarks/test_1000x.py::test_1000x_writes 0.22866671826311824 iter/sec (stddev: 0.06798163248431374) 0.6082224473774979 iter/sec (stddev: 0.2743384634436813) 2.66
benchmarks/test_standard.py::test_standard 0.5687366890704041 iter/sec (stddev: 0.09595898752755323) 0.6195327058812389 iter/sec (stddev: 0.112121109388099) 1.09

This comment was automatically generated by workflow using github-action-benchmark.

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: fc19e85 Previous: d6906de Ratio
benchmarks/test_1000x.py::test_1000x_writes 0.22866671826311824 iter/sec (stddev: 0.06798163248431374) 0.6082224473774979 iter/sec (stddev: 0.2743384634436813) 2.66

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.