We were getting reports of slow dbt seed times and even saw that it applied to some other dbt tasks too.
Thanks to @daveworth pointing out we added an inspect.stack() call in #691 that may be slow!
This analysis of the stack is necessary to decide if we should return fal or the DB adapter type in the adapter.type() call. This is to make dbt packages that make decisions based on adapter.type() work.
This approach reduces time greatly because inspect.stack() by default loads the file of each function in the stack to take some context to show (some lines).
Description
We were getting reports of slow
dbt seed
times and even saw that it applied to some other dbt tasks too.Thanks to @daveworth pointing out we added an
inspect.stack()
call in #691 that may be slow!This analysis of the stack is necessary to decide if we should return
fal
or the DB adapter type in theadapter.type()
call. This is to make dbt packages that make decisions based onadapter.type()
work.This approach reduces time greatly because
inspect.stack()
by default loads the file of each function in the stack to take some context to show (some lines).The time difference I am seeing with the seed data from https://github.com/fal-ai/jaffle_shop_with_fal is:
Base comparison WITHOUT dbt-fal:
Before:
After:
We should try to make this better, but feels like an acceptable result for now.