162 karma · joined Nov 5, 2012 (14y ago) · 91 submissions
comment 4y ago · link · parent
https://medium.com/@MartinCracauer/static-type-checking-in-t...
comment 5y ago · link · parent
I use those functions in both scripts and my interactive shell (which is bash).
I cannot do the same with zsh as my interactive shell if scripting is supposed to stay POSIX/bourne shell. Which I want as I often do this in systemwide scripts or modify existing scripts (all plain sh). The incompatibilities do matter.
comment 5y ago · link · parent
You can add type declarations and a good compiler will check against them at compile time: https://medium.com/@MartinCracauer/static-type-checking-in-t...
comment 6y ago · link · parent
This can go really bad, for example in systems that keep caches/repositories of preallocated things for faster re-use. If they are anchored at global variables, or near global, then you need to treat those preallocated things special. You can't just go and move them every time even when knowing you will never collect them.
Generally, GC works better if you don't do tricks/optimizations with memory allocation and let just everything flow freely into the heap. If you do have to optimize allocation you generally have to teach your GC about your hack.
comment 6y ago · link · parent
Let later placement be decided by the order in which the heap is scavenged. That is what e.g. re-unifies array-of-pointer target instances. You scavenge the array of pointers and in the default case you line up the instances the pointers point to beautifully one after another. Even if the initial allocation had interleaving other memory. In that case your code gets faster after GC than before the data is first GCed.
comment 6y ago · link · parent
Keep in mind that you only have a tiny amount of L1 data cache lines. They are gone so quickly. If you can get a couple more struct instances in an array into those cache lines (without the cache lines holding unrelated nonsense as a byproduct of a memory fetch) that is a huge win.
The issue of L1 cache lines is more important than the size of the L1 cache. The granularity of the cache lines uses up the size of the cache very quickly if all cache lines are padded up with 3/4rd nonsense that you don't need right now.
comment 6y ago · link · parent
But if you cannot move memory (adjust pointers like most GCs do) then you will have to deal with fragmentation, which slows down allocation (or causes other drawbacks).
Moving GC can also make the program faster due to memory compactation and hence being more efficient wrt CPU cache and TLB.
comment 6y ago · link · parent
The reason being that allocation can be much faster. The GCed code can allocate memory with as much as an increment of a pointer (and that is atomic, so no thread locking needed).
malloc/free always do full function calls, and they might/will descent into dealing with fragmentation (aka finding free space). Likewise, free() isn't free and cross-thread allocation/deallocation can further complicate things.
comment 6y ago · link · parent
https://medium.com/@MartinCracauer/generational-garbage-coll...
And a review of LLVM's GC facilities: https://medium.com/@MartinCracauer/llvms-garbage-collection-...
Overall message is that there are many different ways to get to the destination, and creative solutions are mixed in.
26.
Paul Graham re-states programming language preference(twitter.com ↗)
3 points · by cracauer · 7y ago · discuss
comment 7y ago · link · parent
The QPX search engine is actually the same behind Google flights and all the airlines and what Orbitz used to use. The limitation pre google/flights was the on-demand querying only.
Now the contiguous querying, obviously, gives you a load of useful historical data. After running it for a couple of years now they seem to feel confident that they can predict prices changes with enough accuracy that the payouts for misses will be an acceptable price for the publicity, or increased use of their other travel products.
(disclaimer: ex-ITA/Xoogler, opinions my own)
comment 7y ago · link · parent
Page faults from NFS client side aren't served by the server when they should (readonly map, reading a page). I could imagine this is related.