adrienpoly / rubyvideo

Indexing all Ruby related videos
https://rubyvideo.dev
259 stars 51 forks source link

Reduce CI test time #392

Closed fixlr closed 2 weeks ago

fixlr commented 2 weeks ago

Hi! 👋

I've been lurking on this project for a little while, and happened to have a free morning available when issue #391 showed up in my inbox. 😄

I did some rough benchmarking of db:seed locally, and found that the majority of the time is spent updating talks, and 50%+ of that duration was spent on the following two lines in Talk#update_from_yml_metadata!:

With these two commits, I'm seeing db:seed run in ~27 seconds locally now. 🎉

Before

assign_attributes total elapsed: 46.42051896639168
unused_slugs.first total elapsed: 20.0830240547657

After

assign_attributes total elapsed: 0.23879502154886723
unused_slugs.first total elapsed: 2.2362280655652285
marcoroth commented 2 weeks ago

Oh sweet, thank you for looking into this @fixlr!

I was suspecting that there were things to improve in the way we seed, but I didn't expect it would be that significant. This is awesome, thank you!

adrienpoly commented 2 weeks ago

this is great thanks @fixlr