Unnamed namespaces and Visual C++ linker performance -


does putting code in unnamed namespaces improve linker performance in way?

theoretically, linker has less data deal when linking object files produced different compilation units. however, vc++ linker's performance benefit putting code in un-named namespaces?

i asked same question here, , got following answer microsoft representative:

that save symbol lookup time @ best. think it's reasonable expect symbol lookup uses hashtable or other efficient enough data structure , number of symbols doesn't affect link time significantly.

besides, quick @ .obj file contains unnamed namespaces shows members of such namespace still have external linkage (that appears bug, far can tell they're supposed have internal linkage) still contribute global scope symbol table.

so if save time of building "the hash table symbols participate in cross-obj-file linkage" not matter, symbols still marked participate in external linkage.


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -