summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcoryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2001-05-07 18:20:41 +0000
committercoryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2001-05-07 18:20:41 +0000
commit009b432ac7a65791249dc70e33583ea17c7704b5 (patch)
tree58a2c7110f053199f0e54852a08bd58e846d4c45
parentec0d0a40b7af30a666fd634b2612e7c566b93eca (diff)
downloadATCD-009b432ac7a65791249dc70e33583ea17c7704b5.tar.gz
ChangeLogTag:Mon May 07 10:47:11 2001 Carlos O'Ryan <coryan@uci.edu>
-rw-r--r--TAO/ChangeLogs/ChangeLog-02a10
-rw-r--r--TAO/tao/GIOP_Message_Base.cpp22
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 <coryan@uci.edu>
+
+ * 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 <coryan@uci.edu>
* 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 <size> 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