[ 
https://issues.apache.org/jira/browse/TS-1102?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13214638#comment-13214638
 ] 

Uri Shachar commented on TS-1102:
---------------------------------

First thing first: --disable-diags does not do anything (it sets TS_USE_DIAGS 
to 0 but Diags.h tests if is defined or not)....

I haven't been able to reproduce anything close to a 15% degradation, but i 
have seen 1.7%. Looks like the increased overhead of always calling the 
multiple argument function outweighs everything else. When I do:
-#define Diag(tag, fmt, ...)      diags->log(tag, DTA(DL_Diag), fmt, 
##__VA_ARGS__)
+#define Diag(tag, fmt, ...)      if (diags->on(tag)) diags->log(tag, 
DTA(DL_Diag), fmt, ##__VA_ARGS__)

and remove the diags->on(tag) call in the beginning of Diags::log the we get 
the slight perf boost I expected when a tag is turned on, and no impact when 
diags is turned off.
Attaching a patch (with the DebugOn removal) + the benchmark results that I got.

                
> Cleanup obsolete debugging code
> -------------------------------
>
>                 Key: TS-1102
>                 URL: https://issues.apache.org/jira/browse/TS-1102
>             Project: Traffic Server
>          Issue Type: Bug
>          Components: Core, Logging, Performance
>    Affects Versions: 3.0.2
>         Environment: Any
>            Reporter: Uri Shachar
>            Assignee: Leif Hedstrom
>            Priority: Minor
>             Fix For: 3.1.3
>
>         Attachments: diags_cleanup.patch, diags_remove_debugon.patch, 
> remove_prefix_arg.patch, remove_prefix_arg_v2.patch, 
> remove_prefix_arg_v3.patch
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> The current Diags.h D/EClosure mechanism is obsolete. ATS requires gcc >= 4.1 
> for all compilation environments, and it includes variadic argument macro 
> support with ##_VA_ARGS_ that deletes the final comma if no arguments are 
> provided.
> Removing the added layer should also improve performance when high volume 
> debugging is turned on.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to