class_docstr: Benchmarks for `tf.data.experimental.snapshot()`.
class_docstr_tok: ["Benchmarks","for","`","tf.data.experimental.snapshot","(",")","`","."]
code: def benchmarkReadSnapshotSnappyCompression(self):
      num_elements = 100000
      tmp_dir = self._makeSnapshotDirectory()
      dataset = self._createSimpleDataset(
          num_elements=num_elements,
          tmp_dir=tmp_dir,
          compression=snapshot.COMPRESSION_SNAPPY,
      )
  
      # consume all the elements to let snapshot write things to disk
      self.run_benchmark(
          dataset=dataset,
          num_elements=num_elements,
          iters=1,
          warmup=False,
          apply_default_optimizations=True,
      )
      # Now run the actual benchmarks and report them
      self.run_and_report_benchmark(
          dataset=dataset,
          num_elements=num_elements,
          name="read_snappy",
          extras={
              "model_name": "snapshot.benchmark.7",
              "parameters": "%d" % num_elements,
          },
      )
  
file_path: tensorflow/tensorflow/python/data/experimental/benchmarks/snapshot_dataset_benchmark.py
imports: import os
  import shutil
  from tensorflow.python.data.benchmarks import benchmark_base
  from tensorflow.python.data.experimental.ops import snapshot
  from tensorflow.python.data.ops import dataset_ops
  from tensorflow.python.ops import gen_array_ops
  from tensorflow.python.platform import test
label_desc: Use image node_id 9 for calling the SnapshotDatasetBenchmark obj's underlying member method code with example usage: obj.benchmarkReadSnapshotSnappyCompression() without return types