[
https://issues.apache.org/jira/browse/ARIES-1319?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14623436#comment-14623436
]
Dmitry Konstantinov commented on ARIES-1319:
--------------------------------------------
Test results are the following:
# Test environment:
#* MacOS, 2,66 GHz Intel Core i7, GB 1067 MHz DDR3
#* JDK 1.8.0_05-b13
#* Apache Karaf 3.0.4 as a baseline (blueprint-core 1.4.3)
# Test scenario: invocations of simple test service (implements a interface)
published via Aries Blueprint. To invoke the service a single thread is used.
Results (Blueprint - using Bluepint injected reference; Direct - using direct
reference to the service object, just to compare and estimate overheads):
# Before patch
{code}
karaf@root()> test:blueprint 100000000 10
Iteration: 0
Executing time: 10821 ms, count: 100000000 - Blueprint
Executing time: 200 ms, count: 100000000 - Direct
Iteration: 1
Executing time: 10789 ms, count: 100000000 - Blueprint
Executing time: 192 ms, count: 100000000 - Direct
Iteration: 2
Executing time: 10649 ms, count: 100000000 - Blueprint
Executing time: 66 ms, count: 100000000 - Direct
Iteration: 3
Executing time: 10603 ms, count: 100000000 - Blueprint
Executing time: 71 ms, count: 100000000 - Direct
Iteration: 4
Executing time: 10590 ms, count: 100000000 - Blueprint
Executing time: 63 ms, count: 100000000 - Direct
Iteration: 5
Executing time: 10658 ms, count: 100000000 - Blueprint
Executing time: 63 ms, count: 100000000 - Direct
Iteration: 6
Executing time: 10524 ms, count: 100000000 - Blueprint
Executing time: 61 ms, count: 100000000 - Direct
Iteration: 7
Executing time: 10622 ms, count: 100000000 - Blueprint
Executing time: 72 ms, count: 100000000 - Direct
Iteration: 8
Executing time: 10661 ms, count: 100000000 - Blueprint
Executing time: 62 ms, count: 100000000 - Direct
Iteration: 9
Executing time: 10697 ms, count: 100000000 - Blueprint
Executing time: 65 ms, count: 100000000 - Direct
{code}
# After patch
{code}
karaf@root()> test:blueprint 100000000 10
Iteration: 0
Executing time: 3394 ms, count: 100000000 - Blueprint
Executing time: 62 ms, count: 100000000 - Direct
Iteration: 1
Executing time: 3385 ms, count: 100000000 - Blueprint
Executing time: 62 ms, count: 100000000 - Direct
Iteration: 2
Executing time: 3391 ms, count: 100000000 - Blueprint
Executing time: 63 ms, count: 100000000 - Direct
Iteration: 3
Executing time: 3418 ms, count: 100000000 - Blueprint
Executing time: 66 ms, count: 100000000 - Direct
Iteration: 4
Executing time: 3404 ms, count: 100000000 - Blueprint
Executing time: 62 ms, count: 100000000 - Direct
Iteration: 5
Executing time: 3385 ms, count: 100000000 - Blueprint
Executing time: 71 ms, count: 100000000 - Direct
Iteration: 6
Executing time: 3544 ms, count: 100000000 - Blueprint
Executing time: 61 ms, count: 100000000 - Direct
Iteration: 7
Executing time: 3378 ms, count: 100000000 - Blueprint
Executing time: 61 ms, count: 100000000 - Direct
Iteration: 8
Executing time: 3426 ms, count: 100000000 - Blueprint
Executing time: 64 ms, count: 100000000 - Direct
Iteration: 9
Executing time: 3422 ms, count: 100000000 - Blueprint
Executing time: 63 ms, count: 100000000 - Direct
{code}
> Reduce memory allocation in org.apache.aries.blueprint.proxy.Collaborator
> class
> -------------------------------------------------------------------------------
>
> Key: ARIES-1319
> URL: https://issues.apache.org/jira/browse/ARIES-1319
> Project: Aries
> Issue Type: Improvement
> Components: Blueprint
> Affects Versions: blueprint-core-1.4.2
> Reporter: Dmitry Konstantinov
>
> In case of intensive usage there is an memory and CPU overhead in
> org.apache.aries.blueprint.proxy.Collaborator which can be easy eliminated:
> 1) Stack has a thread safety overhead, it can be replaced by ArrayDeque, the
> stack is used in a single thread
> 2) In case of there are no interceptors - it make sense to not allocate each
> time a Stack object. The reference can be set to null or a static immutable
> empty stack value.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)