4 ms·
I do have some testing that showed me the Common Lisp was roughly the same speed as the C, when testing against a file of a few dozen megabytes. As I explain,
by verisimilitudes 7y ago
I do have some testing that showed me the Common Lisp was roughly the same speed as the C, when testing against a file of a few dozen megabytes. As I explain, I wasn't interested in optimizing it further, as I feel showing this achieved in just a few minutes to be valuable on its own. I also note that a C programmer may boast about being a small fraction of a second faster, ignoring everything else that goes into the program, which I find foolish.
The reason I didn't strictly adhere to the POSIX behavior was because I don't know where this is documented and don't feel like scanning through the C to find out. On all of the files I've tested, which include a wide array of punctuation and other such things, the results were identical, but I'm merely not making any promises. I'd prefer to not be accused of being one of those Lispers who only complete part of the program; if you look at the libraries I've written, which actually concern me, then you'll find they're well-documented and rather comprehensive for their purposes.
- reikonomusha 7y agoI think it would be a great addition to the article to show the speed as-is with a couple measurements, then show what popping in a few DECLAREs does.
- threatofrain 7y agoThat data is context for your claims, and we're missing it.
- santoshalper 7y agoSure, but he's not going to provide it because it either (a) doesn't exist or (b) doesn't support his argument.
- fwip 7y agoPOSIX specifications are available here: https://pubs.opengroup.org/onlinepubs/9699919799/idx/utilities.html https://pubs.opengroup.org/onlinepubs/9699919799/idx/utiliti...
- saagarjha 7y agoTIL C99 is part of the POSIX standard…
- fwip 7y agoYeah, there's a number of surprising (but optional) inclusions. c99 is part of the "C-Language Development Utilities" optional group.
- LukeShu 7y agoPOSIX is about compatibility for 2 programming languages: C99 and Bourne Shell. POSIX incorporates the C99 spec by reference, and duplicates much of it (lots of pages say "The functionality described on this reference page is aligned with the ISO C standard. Any conflict between the requirements described here and the ISO C standard is unintentional."), but does not fully include/duplicate the C99 spec.
- fwip 7y agoI timed it on a 329MB 'tags' file I had lying around, and got 30.6 seconds for the lisp version, vs. 1.07 seconds for the BSD-style `wc` shipped with OSX. I used SBCL installed from brew.