From: Josh M. <jos...@an...> - 2012-09-01 10:50:22
|
Hi Dave, this definitely improves the readability of the generated code. For our codes, there will be some changes required to definitions of native methods but this looks like only a few minutes' work. I compared compile times for ANU-Chem packages on two computers: my ANU desktop which is a Core2 Q9550@2.83GHz with GCC 4.4.3, and my home computer which is a Pentium D (much slower) with GCC 4.6.3. Example times are below: compile times have reduced slightly on the home computer but strangely seem to have actually increased on my ANU desktop. I have no idea why this is. You mentioned that the number of header files included has previously been the major issue, so maybe ref<T> wasn't the main problem after all... Cheers, Josh Uni: GCC 4.4.3 before anu-chem Total time: 1 minute 8 seconds fmm Total time: 1 minute 45 seconds fmm-lib Total time: 1 minute 48 seconds anum Total time: 34 seconds Uni: GCC 4.4.3 after anu-chem Total time: 1 minute 19 seconds fmm Total time: 1 minute 42 seconds fmm-lib Total time: 2 minutes 14 seconds anum Total time: 32 seconds home: GCC 4.6.3 before anu-chem Total time: 3 minutes 14 seconds fmm Total time: 5 minutes 45 seconds fmm-lib Total time: 6 minutes 13 seconds anum Total time: 1 minute 24 seconds home: GCC 4.6.3 after anu-chem Total time: 3 minutes 0 seconds fmm Total time: 5 minutes 24 seconds fmm-lib Total time: 5 minutes 52 seconds anum Total time: 1 minute 7 seconds On 01/09/12 00:49, David P Grove wrote: > > I've just committed the major change in C++ code generation that I've > been contemplating doing for months and have talked to several of you > about....x10aux::ref is no more. > > If you don't know what x10aux::ref is, you can safely ignore the rest > of this email. Modulo any @Native declarations that I failed to > update this change should be completely invisible to the X10 programmer. > > If you write @Native annotations (or native C++ code that needs to > interact with the X10 object model), then read on... > > The heart of the change is that a C++ type that used to be written > ref<T> is now written as T* > > For example: > ref<Array<ref<String> > becomes Array<String*>* > ref(Array<int> > becomes Array<int>* > > Benefits: > (1) Less template instantiation, faster C++ compilation and > more readable/standard C++ types (and symbol names) > (2) We can now actually use C++'s catch blocks properly instead of > generating our own dynamic type tests inside of a single catch. > > Drawbacks (?): > (1) No silent conversion from one pointer type to an arbitrary other > pointer type. > The C++ code generator (and the programmer writing native code) > needs to be more aware of how the X10 and C++ object model > are related to each other and inject reinterpret_casts where needed. > This makes some things more verbose, but based on the thousands > of lines > of code I was modifying yesterday, I think this is actually an > improvement > because the places where something interesting is happening > become explicit. > > --dave > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats.http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > > > _______________________________________________ > X10-core mailing list > X10...@li... > https://lists.sourceforge.net/lists/listinfo/x10-core |