Bug 2042 - Possible optimization in generated code
Summary: Possible optimization in generated code
Status: RESOLVED INVALID
Alias: None
Product: TAO
Classification: Unclassified
Component: IDL Compiler (show other bugs)
Version: 1.4.3
Hardware: All All
: P3 normal
Assignee: Jeff Parsons
URL:
Depends on:
Blocks: 2181
  Show dependency tree
 
Reported: 2005-02-03 08:24 CST by Johnny Willemsen
Modified: 2007-01-09 07:30 CST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Johnny Willemsen 2005-02-03 08:24:19 CST
A possible optimization in the generated code, but not sure if this would work. 
We have to check this. Code if from TAO/tests/IDL_Test. Placeholder because 
Jeff is busy with other things at this moment.

Then another issues, but this is something I don't know for
sure. Take the following code from anonymousC.cpp:
 
// TAO_IDL - Generated from
// be\be_visitor_operation/operation_cs.cpp:78
 
char * All_Anon::anon_bd_string_test::TestFunc (
    ACE_ENV_SINGLE_ARG_DECL
   )
   ACE_THROW_SPEC ((
     CORBA::SystemException
   ))
 {
   if (!this->is_evaluated ())
     {
       ACE_NESTED_CLASS (CORBA,
 Object)::tao_object_initialize (this);
     }
 
   if (this->the_TAO_anon_bd_string_test_Proxy_Broker_ == 0)
     {
       All_Anon_anon_bd_string_test_setup_collocation ();
     }

I wonder if the check for
the_TAO_anon_bd_string_test_Proxy_Broker_ could be done 
within the if check for !this->is_evaluated (). The 
is_evaluated is only called once, the 
the_TAO_anon_bd_string_test_Proxy_Broker_ is checked each 
time, but what if there is just no collocation possible, then 
this All_Anon_anon_bd_string_test_setup_collocation () is 
called each time again. When we move it within the if we just 
try to setup things once. I am not sure if this impacts 
other things.
Comment 1 Jeff Parsons 2005-02-03 08:37:40 CST
Seems the answer to Johnny's question lies in whether tao_object_initialize() 
is ever called elsewhere. If so, then the setup_collocation call could get 
skipped.
Comment 2 Jeff Parsons 2006-02-10 10:52:49 CST
Did we ever get any resolution on this?
Comment 3 Johnny Willemsen 2006-02-13 05:30:56 CST
no, so far as I know we didn't test if this optimization works.
Comment 4 Jeff Parsons 2006-02-13 08:34:36 CST
Okay, I'll leave it open then, so we can possibly come back to it at a later 
date.
Comment 5 Johnny Willemsen 2007-01-09 07:30:51 CST
the is_evaluated flag can be set by true dependent on the creation, so the check
is needed, we can't move it into the is_evaluated check