Skip to content
Lubo Bali
All projects

Data pipelinesFinance

Spark pipeline tuning

A stock signal pipeline made 4× faster, and the bug it was hiding found

4×faster: 183 seconds down to 47 per run

See the code on GitHub (opens in a new tab)

Proof you can check:Code on GitHub

Data pipelines

Same pipeline, 183 s down to 47 s

Before183 s

After47 s

  • Load 29→2
  • Daily totals 4→1
  • Indicators 47→5
  • Correlation 51→15
  • Signal report 19→14
  • Delta write 31→10
  • Summary 1→1

Lubo Bali · lubobali.com

No. 16Measured on Databricks Serverless

The problem

A Spark pipeline gave correct-looking results but ran slowly, and on real data volumes it would take hours or crash. It was also quietly wrong.

What I built

Measured all 7 stages on 1.7 million minute bars, found 8 slow patterns (Python UDFs, needless shuffles, thousands of tiny files) and fixed each one, then compared the results before and after.

Tech & why

PySpark on Databricks with Delta Lake, where this kind of data lives. Each fix is a plain Spark change any team can keep.

  • PySpark
  • Databricks
  • Delta Lake
  • Unity Catalog

The result

4× faster overall, up to 15× on one stage, and 268 buy/sell signal changes (26%) that the old code silently dropped are now caught: it skipped weekends.

Similar projects

Have a problem like this? Get your free AI blueprint in about a minute.

Tell me your problem. I'll find a way to build the solution.

Available now

Book a free 30-min call (opens Calendly in a new tab)

No obligation. Pick a time that suits you.

Prefer email?data@lubobali.com