Skip to main content
The DataStore profiler helps you measure execution time and identify performance bottlenecks.

Quick Start

Enabling Profiling


Profiler API

Getting the Profiler

report()

Display a performance report.
Parameters: Example output:
The report shows:
  • Duration in milliseconds for each step
  • Percentage of parent/total time
  • Hierarchical nesting of operations
  • Metadata for each step (e.g., ops_count, ops)

step()

Manually time a code block.

clear()

Clear all profiling data.

summary()

Get a dictionary of step names to durations (ms).
Example output:

Understanding the Report

Step Names

Duration

  • Planning steps (Query Planning): Usually fast
  • Execution steps (SQL Execution): Where actual work happens
  • Transfer steps (Result to DataFrame): Converting data to pandas

Identifying Bottlenecks


Profiling Patterns

Profile a Single Query

Profile Multiple Queries

Compare Approaches


Optimization Tips

  1. Check SQL Execution Time

If SQL execution is the bottleneck:
  • Add more filters to reduce data
  • Use Parquet instead of CSV
  • Check for proper indexes (for database sources)

  1. Check I/O Time

If read_csv or read_parquet is the bottleneck:
  • Use Parquet (columnar, compressed)
  • Read only needed columns
  • Filter at source if possible

  1. Check Data Transfer

If to_df is slow:
  • Result set may be too large
  • Add more filters or limit
  • Use head() for previewing

  1. Compare Engines


Best Practices

  1. Profile Before Optimizing

  1. Clear Between Tests

  1. Use min_duration_ms for Focus

  1. Profile Representative Data

  1. Disable in Production


Example: Full Profiling Session

Last modified on July 2, 2026