Relationship between performance and the number of call stack layers?
Do the number of call stack layers affect p开发者_如何学JAVAerformance, i.e. cause a performance hit?
There should be no correlation with the depth.
While "chained" scopes do need to be traversed, this is related to lexical scopes and not call stacks. The cost of the call frame ("method call") should be constant -- and independent -- from the depth of the frame.
Happy coding.
精彩评论