|
From: William S F. <ws...@fu...> - 2006-12-07 22:49:06
|
David Beazley wrote: > This might be a dumb question, but what was the motivation and > intended benefit of adding the files swigkeys.c and swigkeys.h in the > Source/Swig directory? These are the files that replace strings > related to hash table lookup (e.g., "type") with a symbolic name like > k_type. Is it a performance hack? Is it a safety feature? It > sure doesn't make the code easier to read in my opinion. I wasn't > able to find any obvious discussion of this in the CHANGES file. > Anyone know? > I'm a bit late joining this thread, but I don't recall any discussion on this, but I always assumed that Marcelo put this in to reduce the swig executable size. I can't think of any other reason for it. I can't imagine how it would reduce performance, but then again compilers are strange beasts. Marcelo did do a lot of profiling of the code though at around that time. As far as I'm concerned, I prefer the compile time aspects of using the k_xyz approach, but really don't mind if we stick with using the C strings instead. Of greater importance is what Dave mentioned - consistency. Implementing and sticking with whichever strategy is chosen is most important. William |