The profiling I did yesterday, using DProf as suggested in a comment from Keith, showed that most of the runtime was spent in the Switch statements that are the heart of the sliding-window scoring algorithm. In new comments, Keith and Conrad explained that 'Switch' is not the fastest way to do the scoring, and that replacing it with a cascade of if/else statements could be a lot faster. (Faithful commenter Neil had also pointed out that Switch is buggy, but it wasn't setting off any alarms.)
So I've just replaced all three of the switch scoring steps with if/else cascades, and here's the spectacular results. Thanks, guys!
RFK Jr. is not a serious person. Don't take him seriously.
3 weeks ago in Genomics, Medicine, and Pseudoscience
Wow! I did mention that using Switch was a bad idea in your original post; but would not have guessed that its performance was so poor as used here.
ReplyDeleteYes, I think Neil deserves the prize for the most foresight.
ReplyDelete