Live data from Hacker News

Folly - The Faceboook open source library

facebook.com

31–40 of 44 posts

Re: Folly - The Faceboook open source library

#31

I suppose I'll have to be the first to express shock that they decided to name it Folly. I feel like Poe's Law is expressing itself.

"Folly" started as an internal codename loosely based on "F"acebook "O"pen source "LL"ibrar"Y". When the time to choose an official name arrived, we found "folly" too funny to not use.

Re: Folly - The Faceboook open source library

#32
post #14

Earlier quoted context omitted.

Hmm, I recently created a private memory allocator so the discussion on the page is somewhat interesting... Only a tiny minority of objects are genuinely non-relocatable: Hmm, I'm not exactly what is meant here. Moving a block of memory from here to there in the most general case will leave your pointers dangling and crash you in no short order. Things that pointed to the data you moved just don't any more. If you ar…

Edit: I think the assumption is that an object itself is relocatable inside a container like vector if it marks itself as such. The document itself doesn't actually explain the inner workings.

Yes, I think the point is that they are indeed glossing over important stuff.

Re: Folly - The Faceboook open source library

#33
post #27
post #15

Earlier quoted context omitted.

Modern heaps typically have some low-fragmentation technique built-in, for example, Windows ships with Low Fragmentation Heap, which is turned on by default since Vista.

What is "low-fragmentation heap"? Why would anyone want "high-fragmentation heap"? (since you imply that it's an option)

Microsoft Low-fragmentation Heap: http://msdn.microsoft.com/en-us/library/windows/desktop/aa36...

Re: Folly - The Faceboook open source library

#34
I'm Tudor, one of the main folly authors. I wrote format, Arena / ThreadCachedArena, DiscriminatedPtr, GroupVarint, TimeoutQueue, and various other pieces (parts of String.h, ThreadLocal, etc), and I'm pretty well-versed with the entire library so I can reasonably answer questions (or poke the appropriate people to make a HN account and answer). Ask away.

Re: Folly - The Faceboook open source library

#35
post #34

I'm Tudor, one of the main folly authors. I wrote format, Arena / ThreadCachedArena, DiscriminatedPtr, GroupVarint, TimeoutQueue, and various other pieces (parts of String.h, ThreadLocal, etc), and I'm pretty well-versed with the entire library so I can reasonably answer questions (or poke the appropriate people to make a HN account and answer). Ask away.

Not necessarily specific to Folly, but I've wondered why vector classes don't have a "short vector optimization" like string classes do. That is, why don't they store 24 bytes or so in place? Is it because the required iterators would take-up too much space anyway?

Re: Folly - The Faceboook open source library

#36
post #34

I'm Tudor, one of the main folly authors. I wrote format, Arena / ThreadCachedArena, DiscriminatedPtr, GroupVarint, TimeoutQueue, and various other pieces (parts of String.h, ThreadLocal, etc), and I'm pretty well-versed with the entire library so I can reasonably answer questions (or poke the appropriate people to make a HN account and answer). Ask away.

Not necessarily specific to Folly, but I've wondered why vector classes don't have a "short vector optimization" like string classes do. That is, why don't they store 24 bytes or so in place? Is it because the required iterators would take-up too much space anyway?

folly::small_vector does just that (and it lets you use one bit for a mutex, too! -- we have a lot of memory-constrained apps so we had to design data structures for them).

We might unify that with fbvector eventually.

Re: Folly - The Faceboook open source library

#37
post #27
post #15

Earlier quoted context omitted.

Modern heaps typically have some low-fragmentation technique built-in, for example, Windows ships with Low Fragmentation Heap, which is turned on by default since Vista.

What is "low-fragmentation heap"? Why would anyone want "high-fragmentation heap"? (since you imply that it's an option)

Low-fragmentation heap puts object of similar size together, so once object is freed, this memory can be reused for other object of similar size without fragmentation. Because of this is has more "slack" - unused memory at the end of the objects that are smaller than their buckets. On other hand, application in steady state is not going slowly increase it's memory use over time.

Also it puts consequently allocated objects (of different size) far away (and thus reduces cache locality), which, in turn may reduce performance for some "allocate a lot of stuff at the beginning and then serve it", etc scenarios, but this is pretty esoteric problem.

Benefits outweigh the concerns, so most apps benefit from the low-fragmentation heaps.

Re: Folly - The Faceboook open source library

#38
post #30

Earlier quoted context omitted.

given the business you run and the work you do for the Freebsd team Are you getting confused between tptacek and me?

Hey, why don't you use C++? :)

I think Tavis put it best: C is easier to audit because it's transparent. With C++ you can have innocuous-looking source code and have the compiler doing all sorts of crazy things behind your back.

Re: Folly - The Faceboook open source library

#39
I'm surprised they used mixed-case file names when their class names are lowercase. You have to remember both capitalizations. Mixed-case file names can also be problematic when porting to case-insensitive file systems like Windows' or Mac OS X'.
Post reply on HN