[personal profile] vshnayder
Ignore unless you're a CS nerd :)

A friend of mine has a program that computes a funky number theoretical function. Unfortunately, it was taking 5 days to run. I volunteered to take a look at it, and managed to reduce the runtime to about 5 minutes by adding 14 characters to the code. Huzzah for optimization! As part of my investigations, I got yet another reminder that trying to guess where the slow bits are is pretty much useless. The actual culpit turned out to be that the math package she was using decided for some reason to use really really slow symbolic computations of floor() and ceil() instead of just using the built in versions. A couple of casts, and voila--a couple of orders of magnitude of improvement. But I would never have suspected that just by staring at the code.
From:
Anonymous( )Anonymous This account has disabled anonymous posting.
OpenID( )OpenID You can comment on this post while signed in with an account from many other sites, once you have confirmed your email address. Sign in using OpenID.
User
Account name:
Password:
If you don't have an account you can create one now.
Subject:
HTML doesn't work in the subject.

Message:

 
Notice: This account is set to log the IP addresses of everyone who comments.
Links will be displayed as unclickable URLs to help prevent spam.

Profile

vshnayder

September 2009

S M T W T F S
   12345
6789101112
13141516171819
20212223 242526
27282930   

Style Credit

Expand Cut Tags

No cut tags
Page generated Sep. 21st, 2017 06:50 am
Powered by Dreamwidth Studios