in reply to Anyway to Have Strong-Like Typing
First, profile your code. Make sure the slow chunks really are where you think they are. I like Devel::NYTProf, particularly with its nytprofhtml utility. It makes drilling though profiles fast and easy.
Second, assuming the math is the slow part, I can think of two fairly easy solutions:
PDL. From the docs:
PDL is the Perl Data Language, a perl extension that is designed for scientific and bulk numeric data processing and display.I haven't used it, but depending on the math you want to do, it's probably the lowest overhead dive to get good performance.
Inline::C. In this case, I have used it, and I like it a lot. However, it will require that you program in C in order to do your fast operations. It buys you ease in terms of getting the Perl code to call C.
You can't get something for nothing, but if you are doing heavy numerics in Perl, there is almost assuredly opportunity for growth.
#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Anyway to Have Strong-Like Typing
by jmmitc06 (Beadle) on Aug 13, 2014 at 04:35 UTC | |
by BrowserUk (Patriarch) on Aug 13, 2014 at 05:57 UTC | |
by etj (Priest) on May 20, 2022 at 15:02 UTC |