From 009b432ac7a65791249dc70e33583ea17c7704b5 Mon Sep 17 00:00:00 2001 From: coryan Date: Mon, 7 May 2001 18:20:41 +0000 Subject: ChangeLogTag:Mon May 07 10:47:11 2001 Carlos O'Ryan --- TAO/ChangeLogs/ChangeLog-02a | 10 ++++++++++ TAO/tao/GIOP_Message_Base.cpp | 22 +++++++++------------- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/TAO/ChangeLogs/ChangeLog-02a b/TAO/ChangeLogs/ChangeLog-02a index 8ac43162a10..b7f8214d85e 100644 --- a/TAO/ChangeLogs/ChangeLog-02a +++ b/TAO/ChangeLogs/ChangeLog-02a @@ -1,3 +1,13 @@ +Mon May 07 10:47:11 2001 Carlos O'Ryan + + * tao/GIOP_Message_Base.cpp (write_protocol_header): + Optimize the implementation of this function. Insted of + marshaling each field of the GIOP header individually we create + one big octet array, store all the fields there (they are octets + for the most part) and then marshal the whole header in a single + operation. Saves a little over 0.5% on the client and server + sides. + Mon May 07 10:35:27 2001 Carlos O'Ryan * tests/Big_Twoways/Big_Twoways.dsw: diff --git a/TAO/tao/GIOP_Message_Base.cpp b/TAO/tao/GIOP_Message_Base.cpp index 04b587cbc10..d564b85ff37 100644 --- a/TAO/tao/GIOP_Message_Base.cpp +++ b/TAO/tao/GIOP_Message_Base.cpp @@ -449,35 +449,31 @@ TAO_GIOP_Message_Base::write_protocol_header (TAO_GIOP_Message_Type t, // Reset the message type msg.reset (); - static CORBA::Octet magic[] = + CORBA::Octet header[12] = { // The following works on non-ASCII platforms, such as MVS (which // uses EBCDIC). 0x47, // 'G' 0x49, // 'I' 0x4f, // 'O' - 0x50, // 'P' + 0x50 // 'P' }; - static int magic_size = sizeof (magic) / sizeof (magic[0]); - - msg.write_octet_array (magic, magic_size); - msg.write_octet (this->generator_parser_->major_version ()); - msg.write_octet (this->generator_parser_->minor_version ()); + header[4] = this->generator_parser_->major_version (); + header[5] = this->generator_parser_->minor_version (); // We are putting the byte order. But at a later date if we support // fragmentation and when we want to use the other 6 bits in this // octet we can have a virtual function do this for us as the // version info , Bala - msg.write_octet (TAO_ENCAP_BYTE_ORDER ^ msg.do_byte_swap ()); + header[6] = (TAO_ENCAP_BYTE_ORDER ^ msg.do_byte_swap ()); - msg.write_octet ((CORBA::Octet) t); + header[7] = CORBA::Octet(t); - // Write a dummy later it is set to the right value... - CORBA::ULong size = 0; - msg.write_ulong (size); + static int header_size = sizeof (header) / sizeof (header[0]); + msg.write_octet_array (header, header_size); - return 1; + return msg.good_bit (); } int -- cgit v1.2.1