4 ms·
This is pretty neat, though I found myself doing similar things in small test files when I was first learning C and printing the results. C compile times suck,
by jparishy 14y ago
This is pretty neat, though I found myself doing similar things in small test files when I was first learning C and printing the results. C compile times suck, but with like a 10 line program or so to toy with a language semantic, it was practically instant (in 2007). But then again I had never used a dynamic language like Ruby/Python before then so I didn't know better.
More people should be hopping on this bandwagon though because debuggers are awesome. I typically find myself using `po` the most in LLDB (Xcode, iOS development) but it's insanely useful especially when Xcode refuses to show me the values of something I want in the Variables View, ex. NSDictionary keys/values, objects in an NSArray, etc. I'll also use it sometimes to execute simple commands like `[myArrayObject count]` when the Variables View refuses to show me property values. Sometimes Xcode's GUI bits just don't cut it!
There's more info on what you can do with LLDB here:
http://lldb.llvm.org/tutorial.html http://lldb.llvm.org/tutorial.html
And if you've used GDB, this might be of use:
http://lldb.llvm.org/lldb-gdb.html http://lldb.llvm.org/lldb-gdb.html
- geoka9 14y ago> C compile times suck Can I ask you what you're comparing with? I can compare with C++, Scala and Go. The first two are horrible in that department when compared with C. Go's compiles are blazingly fast.
- jparishy 14y agoI'm not really comparing it to anything, just speaking from experience of having waited many hours waiting for C programs to compile in the past.
- ghshephard 14y agoIsn't the job of your Makefile to require recompilation of only those source files that have changed? I just did a random google of "how long to compile linux kernel" and came across this: https://plus.google.com/u/0/+LinusTorvalds/posts/6BxnSisp8fU https://plus.google.com/u/0/+LinusTorvalds/posts/6BxnSisp8fU One nice excerpt: "Total build time after make clean is about 1min, give or take 10secs. `touch include/linux/version.h` is 6 seconds to rebuild. Just doing a rebuild without touching anything is 2.7secs. For a defconfig, it does build a godawful amount of modules :^) 'allnoconfig; make' is 16 seconds..."
- infinite8s 14y agoYou've probably never tried compiling the linux kernel back in the late 90s with a top of the line machine (hint - gcc was slow, it would take over 35 minutes or so to compile from scratch) ;)