In my last post, I talked about a PHP profiler I was going to use. I spent this morning learning how to use it, and I like it. It comes with some excellent debugging functions, and the software for profiling is very useful. As I suspected, SQL was the biggest source of slowdown behind the R graphs -- that is, one SQL query was. I use a very simple query to return the latest week in the class being viewed. That query was joining a table that had nothing whatever to do with anything. Due to the vagaries of relational calculus, this meant I was computing the maximum number of 3 million rows. Two words removed from that query and SQL queries hardly made a blip anymore.
This is where things took a turn for the worse. Emboldened, I decided to tackle the speed of the R graphs. It didn't look as if R were parallelizing, so I decided to try and make it. The creation of each graph was very simple in itself -- splitting each graph into its own thread could really help. So I thought. I haven't found out yet.
I spent a long while figuring out how to parallelize, installed the package, tested the function, and tried to insert it into my PHP object. It didn't work, but the code it created seemed to sometimes work. I tried to put things back to non-parallelization for now...and it still didn't work. I went back to an earlier revision of my PHP object, way before any changes I made -- no dice. I'm debugging now, but I figured I'd post. I've got to get this fixed by tonight.
No comments:
Post a Comment