機能 #4176
omniidl shortcutの利用
100%
Description
IDLコンパイラ実行時に-Wbshortcutオプションを追加することで関数を直接呼び出せるようにする。
サンプルを見たところLOCAL_CALLS_SHORTCUTのポリシーを設定したPOAを使用する必要があるようなので、新たに子POAを生成する。
Associated revisions
[incompat] refs #4176
[incompat] refs #4176
[incompat] refs #4176
merged changed from trunk/OpenRTM-aist r3037, 3042-3048, 3089 during 2017-09:
[incompat,->RELENG_1_2] omniORB's shortcut POA is applied to data ports. refs #4176
[incompat,->RELENG_1_2] omniORB's shortcut POA is applied to data ports. refs #4176
[compat,->RELENG_1_2] Analyzer sample has been added in windows source package. refs #4202
[compat,bugfix,->RELENG_1_2] The header setting of the Visual Studio solution file has been fixed. refs #4201 and #4172
[compat,->RELENG_1_2] vc2017 version has been changed from vc15 to vc141. refs #4172
[compat,->RELENG_1_2] vc2017 version has been changed from vc15 to vc141. refs #4172
[compat,rtc.conf,->RELENG_1_2] A bug in preconnection option parser, which crash when ConnectorProfiles are not given or invalid format, fixed.
[compat,->RELENG_1_2] When executing cmake, it is not influenced by the system environment variable. refs #4171
[compat,example,->RELENG_1_2] Throughput measurement component example added.
[incompat,->RELENG_1_2] Extension module header files have been added to rpm package. refs #4368
merged changed from trunk/OpenRTM-aist r3037, 3042-3048, 3089 during 2017-09:
[incompat,->RELENG_1_2] omniORB's shortcut POA is applied to data ports. refs #4176
[incompat,->RELENG_1_2] omniORB's shortcut POA is applied to data ports. refs #4176
[compat,->RELENG_1_2] Analyzer sample has been added in windows source package. refs #4202
[compat,bugfix,->RELENG_1_2] The header setting of the Visual Studio solution file has been fixed. refs #4201 and #4172
[compat,->RELENG_1_2] vc2017 version has been changed from vc15 to vc141. refs #4172
[compat,->RELENG_1_2] vc2017 version has been changed from vc15 to vc141. refs #4172
[compat,rtc.conf,->RELENG_1_2] A bug in preconnection option parser, which crash when ConnectorProfiles are not given or invalid format, fixed.
[compat,->RELENG_1_2] When executing cmake, it is not influenced by the system environment variable. refs #4171
[compat,example,->RELENG_1_2] Throughput measurement component example added.
[incompat,->RELENG_1_2] Extension module header files have been added to rpm package. refs #4368
History
#1 Updated by n-miyamoto almost 6 years ago
- File vx_test.png vx_test.png added
- File result_direct_vx.txt result_direct_vx.txt added
- File result_shortcut_vx.txt result_shortcut_vx.txt added
- File result_cdr_vx.txt result_cdr_vx.txt added
- File result_cdr_ubuntu.txt result_cdr_ubuntu.txt added
- File result_direct_ubuntu.txt result_direct_ubuntu.txt added
- File result_shortcut_ubuntu.txt result_shortcut_ubuntu.txt added
- Status changed from 新規 to 担当
- % Done changed from 0 to 80
- 修正内容
ShortCutポリシーを設定したPOA取得用にManagerにtheShortCutPOA関数、getShortCutPOA関数を追加しました。
また、ManagerのinitORB関数内にPOAの生成を追加しました
#ifdef ORB_IS_OMNIORB CORBA::PolicyList pl; pl.length(1); #ifdef RTM_OMNIORB_42 pl[0] = omniPolicy::create_local_shortcut_policy(omniPolicy::LOCAL_CALLS_SHORTCUT); #else CORBA::Any v; v <<= omniPolicy::LOCAL_CALLS_SHORTCUT; pl[0] = m_pORB->create_policy(omniPolicy::LOCAL_SHORTCUT_POLICY_TYPE, v); #endif m_pShortCutPOA = m_pPOA->create_POA("shortcut", m_pPOAManager, pl); #endif
InPortCorbaCdrProvider、OutPortCorbaCdrProviderをshortcut用POAでアクティブ化するようにコードを追加した。
#ifdef ORB_IS_OMNIORB ::RTC::Manager::instance().theShortCutPOA()->activate_object(this); #endif
CMakeLists.txt内でomniid実行時に-Wbshortcutオプションを追加するように変更しました。
SET(IDLCOMMAND_FLAGS -bcxx -Wba -nf -Wbshortcut)
- 実験(Ubuntu)
Ubuntu上で10[B]のデータを10万回通信して比較を行いました。
通信方式 | 平均[ms] |
corba_cdr(POA経由) | 0.102864 |
corba_cdr(shortcut) | 0.0822503 |
direct | 0.0818192 |
見ての通り0.02[ms]程度しか差がないため、データポートが100個通信するとかいう状況でもないと意味はなさそうです。
- 実験(VxWorks)
VxWorks上で同様の実験を行った場合以下のようになります。
通信方式 | 平均[ms] |
corba_cdr(POA経由) | 0.12463 |
corba_cdr(shortcut) | 0.099306 |
direct | 0.154659 |
何故directの方がcorba_cdrよりも遅いのかは謎ですが、グラフからも転送速度はshortcut>corba_cdrなのは間違いないようです。
#2 Updated by n-miyamoto over 5 years ago
- Status changed from 担当 to 解決
- % Done changed from 80 to 100
#3 Updated by n-miyamoto over 4 years ago
- Status changed from 解決 to 終了
[incompat] refs #4176