You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2021/05/17 14:44:48 UTC

[GitHub] [skywalking-nginx-lua] membphis commented on a change in pull request #83: use table.concat to optimize performance

membphis commented on a change in pull request #83:
URL: https://github.com/apache/skywalking-nginx-lua/pull/83#discussion_r633595423



##########
File path: lib/skywalking/segment_ref.lua
##########
@@ -59,14 +59,16 @@ end
 
 -- Return string to represent this ref.
 function _M.serialize(ref)
-    local encodedRef = '1'
-            .. '-' .. encode_base64(ref.trace_id)
-            .. '-' .. encode_base64(ref.segment_id)
-            .. '-' .. ref.span_id
-            .. '-' .. encode_base64(ref.parent_service)
-            .. '-' .. encode_base64(ref.parent_service_instance)
-            .. '-' .. encode_base64(ref.parent_endpoint)
-            .. '-' .. encode_base64(ref.address_used_at_client)
+    local encodedRef = table.concat({

Review comment:
       Performance in this way will be lower. 
   
   `table.concat` is only needed when the number of elements of concat is not fixed.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org