Skip to content

20% performance regression in 1.1.2/1.1.3 #2358

@nicolaerosia

Description

@nicolaerosia

Hello,

I believe there is a performance regression between 1.1.1 and 1.1.2

Simple reproducer

import statistics
import timeit

import pandas as pd
import prophet

# https://raw.githubusercontent.com/facebook/prophet/main/examples/example_wp_log_peyton_manning.csv
#df_in = pd.read_csv("./example_wp_log_peyton_manning.csv")
df_in = pd.read_csv("https://raw.githubusercontent.com/facebook/prophet/main/examples/example_wp_log_peyton_manning.csv")

def run_prophet_speedtest(periods=30, include_history=False, holiday=True):
    m = prophet.Prophet(mcmc_samples=0, uncertainty_samples=1000)
    if holiday:
        m.add_country_holidays(country_name="US")
    m.fit(df_in)

    # Python
    future = m.make_future_dataframe(periods=periods, include_history=include_history)
    forecast = m.predict(future)
    return m, forecast


t = timeit.Timer(lambda: run_prophet_speedtest())

ret = t.repeat(repeat=10, number=6)
mean = statistics.mean(ret)
median = statistics.median(ret)
std = statistics.stdev(ret)

print(f"results: {ret}")
print(f"mean: {mean}, median: {median}, std: {std}")

try with:

pip install prophet==1.1.1
pip install prophet==1.1.2

I have also my own build on which I have cherry picked some commits, and I get a speed increase compared to 1.1.1, with this commit: 0716751

I still need to bisect, but I suspect it's either the fourier related commits or this warm start, eb71d01 . Any ideas?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions