Repository navigation
Сreate a tail call diagnoser - #573
Hidden character warning
Conversation
adamsitnik
left a comment
There was a problem hiding this comment.
@GeorgePlotnikov you have done a great job. However, I am not sure if this enough to cover also F# case. As far as I know, C# compiler does not generate IL opcode for the tail call. But some JITs can do the tail call optimization. This is covered with your example.
However, when it comes to F#, the F# compiler emits the tail call optimization code or simply replaces the code with a simple jump in place(goto the beginning of the method).
Could you also make some research about F# edge cases and cover them? Please let me know if you are interested in doing this.
| { | ||
|
|
||
| } | ||
| /// <summary> |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| }; | ||
| } | ||
|
|
||
| private bool ShouldPrintEventInfo(Tuple<string, string> namespaces) => !filterByNamespace || namespaces.Item1.StartsWith(expectedNamespace) || namespaces.Item2.StartsWith(expectedNamespace); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| } | ||
|
|
||
| [Benchmark] | ||
| public Diagnostics.Windows.TailCallDiagnoser TypeFromCustomDeoendency1() |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
@adamsitnik thank you very much for your comments, I'll take them into consideration to update the branch. Regarding the F# the case, I'm interested in it, no doubts. If you have some ideas where shall I start the research I would appreciate you a lot. |
|
@adamsitnik added F# support and example to the F# sample project with various kinds of recursion calls. |
| } | ||
|
|
||
| /// <summary> | ||
| /// creates the new TailCallDiagnoser instace |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
AndreyAkinshin
left a comment
There was a problem hiding this comment.
@GeorgePlotnikov, could you write an integration test for this diagnoser?
|
@AndreyAkinshin seems @adamsitnik refused the previously written integration test, because of it was the same as for inline diagnoser, so it was removed by the second commit. |
|
@GeorgePlotnikov if I understand correctly, the original test just checked that we can do some basic diagnostics stuff. But we need a test which checks the diagnoser output (with lines like Caller, Callee, Tail prefix, Tail call type, and so on). It will help to verify that diagnoser is still working in case of any changes. Right now I have to check it manually before each release, but it will be better to make it automatic and increase the coverage. |
|
@AndreyAkinshin you mean something like BenchmarkDotNet.IntegrationTests.MemoryDiagnoserTests? I think what you are talking about should look like that. Does it make sense? |
yes, something similar. Run some benchmark, with the new diagnoser and check the output of the diagnoser (info about methods reported to the output).
your previous test was just checking if we can have a benchmark, which returns new diagnoser. It was not using the diagnoser. |
|
@AndreyAkinshin , @adamsitnik thank you guys for the review. I'll add the test. |
|
@AndreyAkinshin, @adamsitnik hi guys, I've just added the integration test, please review |
| } | ||
|
|
||
| private IConfig CreateConfig(Jit jit, Platform platform, Runtime runtime, TailCallDiagnoser diagnoser) => ManualConfig.CreateEmpty() | ||
| .With(Job.ShortRun.With(jit).With(platform).With(runtime)) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| namespace BenchmarkDotNet.IntegrationTests | ||
| { | ||
| #if NET46 | ||
| public class TailCallDiagnoserTests : BenchmarkTestExecutor |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
@GeorgePlotnikov, could you also add some information about this diagnoser in our documentation (the |
|
Applied the request review comments to the integration test and pulled the request to update the documentation |
* create a tail call diagnoser * added newline at the end of file * updated to support F# * fix proj references * rename local variables for unification * fix typo * added intergration test for the TailCallDiagnoser * chaged directives regarding the project * fixed warnings * refactored * applied the review comments
Added diagnoser for JIT Tail Call Events, based on JIT Inlining Events diagnoser.