I refer the honourable gentlman to Zed Shaw's "Programmers Need To Learn Statistics Or I Will Kill Them All"
Make Lisp 15x faster than Python or 4x faster than Java
11–20 of 100 posts
Re: Make Lisp 15x faster than Python or 4x faster than Java
#12Now, I wonder whether I could use Lisp for what I do. One basic necessity would be to have a way to define a structure like this
struct s {
int32_t x;
int32_t y;
};
and then create an array of that type as struct s a[size], which uses exactly size * sizeof(s) bytes in memory. A further requirement would be to have a library of data structures (balanced trees, lists, hash tables) that support storing such structs directly without using pointers everywhere.Do you have any idea whether that could work with SBCL?
Re: Make Lisp 15x faster than Python or 4x faster than Java
#13Re: Make Lisp 15x faster than Python or 4x faster than Java
#14The most common way to compute your distance from a deal is to assume the earth is a perfect sphere I thought you would only really be finding deals at distances small enough to just assume the earth is flat. Or at least, aren't those the only ones people would actually be interested in? If it's beyond my physical reach, I don't care how far it is. I'll get it shipped. Or am I missing something?
You're absolutely right - in my experience the pythagorean theorem has less than ~50 meters difference from the Haversine formula for distances less than 20 miles or so. In the actual code I use a simple heuristic to decide when to use which calculation. Like I mentioned in the post, the distance function presented is a bit of a simplification I invented for pedagogical purposes (my goal was to examine languages, not…
Re: Make Lisp 15x faster than Python or 4x faster than Java
#15Re: Make Lisp 15x faster than Python or 4x faster than Java
#16Thanks, that's interesting. My own main optimization problem is always reducing the memory usage of large in memory data sets. I found that languages like Java and Python, which don't support structured value types and use references/pointers everywhere, are basically unusable for my my purposes. Now, I wonder whether I could use Lisp for what I do. One basic necessity would be to have a way to define a structure lik…
I usually don't code at that low level, but you might want to check out www.lrde.epita.fr/~didier/research/verna.06.imecs.pdf
Re: Make Lisp 15x faster than Python or 4x faster than Java
#17Re: Make Lisp 15x faster than Python or 4x faster than Java
#18In all seriousness, how does one start with setting up and learning how to program a CL web app?
Re: Make Lisp 15x faster than Python or 4x faster than Java
#19That said I think these kinds of benchmarks (and article titles) are misleading, because one who has deep knowledge in one language does not necessarily write good code in other languages. Even the article notes that "they are all just literal line-by-line translations of each other".
Re: Make Lisp 15x faster than Python or 4x faster than Java
#20Any guesses as to why the Java implementation is relatively slow? JNI boundary crossings for floating point arithmetic, or lack of use of the math coprocessor?
$ java -version
java version "1.6.0_0"
OpenJDK Runtime Environment (build 1.6.0_0-b11)
OpenJDK 64-Bit Server VM (build 1.6.0_0-b11, mixed mode)