probcomp / bayeslite

BayesDB on SQLite. A Bayesian database table for querying the probable implications of data as easily as SQL databases query the data itself.
http://probcomp.csail.mit.edu/software/bayesdb
Apache License 2.0
922 stars 64 forks source link

Slowdown in Bayeslite or Crosscat #356

Open tibbetts opened 8 years ago

tibbetts commented 8 years ago

I’m seeing 0.1.4 being notably slower on my laptop than 0.1.3.rc2. Specifically running the following queries:

%time q('''simulate Period_Minutes from satellites_cc GIVEN "Users" = 'Military' limit 1000''');

takes 539ms on 0.1.3rc2 and 21s on 0.1.4 in unscientific testing. The underlying crosscat versions are 0.1.38 and 0.1.49 respectively.

tibbetts commented 8 years ago

Profile run with:

import cProfile
cProfile.run("""q('simulate Period_Minutes from satellites_cc GIVEN "Users" = Military limit 1000')""")

bayeslite-0.1.4-profile.txt bayeslite-0.1.3rc2-profile.txt

riastradh-probcomp commented 8 years ago

All the time seems to be spend inside cursor.execute(), in sqlite3/apsw.

A few wild hypotheses to investigate: