Hacker Newsnew | past | comments | ask | show | jobs | submit | ntry's commentslogin

101,000ms to 150ms is a phenomenal speedup. Props


To be fair, the thing he started with was totally unreadable and fits on a business card and the thing he ended up with was readable, but didn't fit. It isn't apples-to-apples.


The original is 1,287 bytes after removing comments and line endings where possible. After just a bit of search-and-replace to shrink variable names, I got the new one down to 2,373 bytes including the same error checking and output at the end. So 1.8 business cards, which is not too bad.

And no I haven't tried to compile it. https://pastebin.com/LDRd6U4e


Hmm, some further improvements:

  typedef float F;typedef int I;
  // saves 2 lines (but zero bytes)
  
  #define R return
  // OR
  #define O(S,A,R) operator S(A){return R;}
  
  #define E(F){E_((F||cudaPeekAtLastError)(),__FILE__,__LINE__);}
and so on - although you'd probably have to make semantic chages to get onto a single card. (Or use a smaller font, but that's presumably cheating.)


I feel like the self-timing and error-checking is unnecessary, and you can at least fit it on the front + back of a business card with enough room left for your name and an email address.


I feel like most people know of this. But oh well, what do I know


Hahaha, that's so true. I've heard of multiple people placing bounties on making this a reality


It seems to me, at least as someone on the outside of this debate looking in, that people are having some trouble defining what "better" actually means. I think if the difference could be quantified, it could be addressed.


Ken Kocienda talks about this in his book Creative Selection. While working at Apple, they identified processes that needed to optimized with heuristics as opposed to algorithms. Some things need to be tweaked by a person and cannot be solved by applying an algorithm. He posits that this is the reason Apple has traditionally had such a great user experience with the products.


We have what we like and we have what we don't like. Have to make what we don't like match what we like.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: