Comments on: Link time sorting I played with this a bit last night using XCode w/ GCC 4.2. The mac compiler wants you to specify the segment-name as well (e.g. __DATA). <code>__attribute__((section("__DATA,prius_seg$KFABFCNN")))</code> But the real problem, is that it doesn't appear to do any sorting for you. Anyone know if there's a flag to enable that? Or maybe it depends on which segment you place it in? I'm curious, though -- it seems like this method can only be used in conjunction with code-gen to automate the string hashing and lexical conversion. At that point, why not just write out the structs in sorted order to start with? The only advantage I see, is the ability to split your registration up across multiple files. This is definitely nice, but is a hard tradeoff against portability IMO. What else am I missing? I played with this a bit last night using XCode w/ GCC 4.2.

The mac compiler wants you to specify the segment-name as well (e.g. __DATA).

__attribute__((section("__DATA,prius_seg$KFABFCNN")))

But the real problem, is that it doesn’t appear to do any sorting for you. Anyone know if there’s a flag to enable that? Or maybe it depends on which segment you place it in?

I’m curious, though — it seems like this method can only be used in conjunction with code-gen to automate the string hashing and lexical conversion. At that point, why not just write out the structs in sorted order to start with? The only advantage I see, is the ability to split your registration up across multiple files. This is definitely nice, but is a hard tradeoff against portability IMO. What else am I missing?

]]>
By: Joe Valenzuela/2011/01/22/link-time-sorting/#comment-598 Joe Valenzuela Sun, 23 Jan 2011 01:09:50 +0000 It depends on your project but, yes, link times can be a big problem especially if the project uses link time code generation, has many public symbols, and/or has debug information enabled globally. I've done work on a few projects where link times have been in the 10-15 minute range. It depends on your project but, yes, link times can be a big problem especially if the project uses link time code generation, has many public symbols, and/or has debug information enabled globally. I’ve done work on a few projects where link times have been in the 10-15 minute range.

]]>
By: jayhs/2011/01/22/link-time-sorting/#comment-596 jayhs Sat, 22 Jan 2011 22:07:24 +0000 Interesting, I've been putting similar data in separate sections for a while but never required any particular ordering. I assume you want to be able to do a binary search for the type during deserialization directly instead of using an external search structure like a hash map or vector_map? Interesting, I’ve been putting similar data in separate sections for a while but never required any particular ordering. I assume you want to be able to do a binary search for the type during deserialization directly instead of using an external search structure like a hash map or vector_map?

]]>