So I've just replaced all three of the switch scoring steps with if/else cascades, and here's the spectacular results. Thanks, guys!
Field of Science
-
-
-
Antibiotics & Agriculture Part 4: The Transfer of Antibiotic Resistance22 hours ago in Memoirs of a Defective Brain
-
Keeping up to date22 hours ago in Games with Words
-
-
-
Supreme Court bungles the science in DNA patent decision3 days ago in Genomics, Evolution, and Pseudoscience
-
-
-
-
-
-
-
-
Thanksgiving2 weeks ago in The Curious Wavefunction
-
-
Bioengineers go retro to build a calculator from living cells4 weeks ago in The Allotrope
-
-
-
-
-
-
-
The Lure of the Obscure? Guest Post by Frank Stahl1 year ago in Sex, Genes & Evolution
-
-
Finding a new translation factor, and verifying it with help from my experimental friends1 year ago in Protein Evolution and Other Musings
-
Free ImageJ Macro -- for citing images1 year ago in Skeptic Wonder
-
-
-
The Large Picture Blog Has Moved1 year ago in The Large Picture Blog
-
Lab Rat Moving House1 year ago in Life of a Lab Rat
-
Goodbye FoS, thanks for all the laughs1 year ago in Disease Prone
-
Branson getting into microbial diversity in the deep sea2 years ago in The Greenhouse
Not your typical science blog, but an 'open science' research blog. Watch me fumbling my way towards understanding how and why bacteria take up DNA, and getting distracted by other cool questions.
Thank you for the comments!
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!
So I've just replaced all three of the switch scoring steps with if/else cascades, and here's the spectacular results. Thanks, guys!
2 comments:
Markup Key:
- <b>bold</b> = bold
- <i>italic</i> = italic
- <a href="http://www.fieldofscience.com/">FoS</a> = FoS
Subscribe to:
Post Comments (Atom)
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