question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Better performance for --showdescription

See original GitHub issue

Currently it’s taking between 4 and 5 seconds. Is there anything that can be done about that? Ideally there would be some way to get it under 500ms.

I added target name autocomplete to my bootstrapper which executes --showdescription, but it freezes the console for 4-5 seconds every time I press tab. 200ms would be so cool though…

I know Cake takes a while to check dependencies and compile, but no one ever creates targets that only conditionally appear, so in my mind we wouldn’t even have to compile the script to obtain the list of calls to Target. But if you wanted to be absolutely completely safe, the --showdescription logic could look like this:

  1. Parse the script file’s syntax
  2. Locate all usages of the name Target
  3. If every usage of Target is a call with a literal string name and the call is not nested under a conditional, add it to the list. Otherwise, finish compiling the script and discover the list the old way.

I’m pretty sure the fallback will never actually be needed though.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
devleadcommented, Jul 10, 2017

Currently it’ll codgen, reference dependencies, compile and execute the C# code. for it to be 200ms likely would have to not do that but rather some specific --showdescription parsing code.

Unsure if this is a a high priority or worth it at the moment, a potential work around would be to in boostrapper use powershell to extract the needed info i.e. something like

[string[]] $tasks = Get-Content .\build.cake|Select-String -Pattern 'Task\("(.*?)"\)' | % Matches | % {$_.Groups[1].Value}

that takes around 8 ms on my machine on cake’s build.cake, resulting in an array containing

Clean
Restore-NuGet-Packages
Build
Run-Unit-Tests
Copy-Files
Zip-Files
Create-Chocolatey-Packages
Create-NuGet-Packages
Sign-Binaries
Upload-AppVeyor-Artifacts
Upload-Coverage-Report
Publish-MyGet
Publish-NuGet
Publish-Chocolatey
Publish-HomeBrew
Publish-GitHub-Release
Create-Release-Notes
Package
Default
AppVeyor
Travis
ReleaseNotes

where it would fail would be if tasks are defined in any other file external to take i.e. included via #load which is one of the complexities as some files make be located in nuget packages needed to be fetched an loaded.

0reactions
jnm2commented, Feb 7, 2019

It this was tracking work that you still want to do, please feel free to reopen! Otherwise, cleaning up due to inactivity.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What are some good strategies for improving the serial ...
First of all, as skillman and Dan have pointed out, profiling is essential. I personally use Intel's VTune Amplifier on Linux as it...
Read more >
General C++ Performance Improvement Tips [closed]
Off the top of my head, one good general performance practice is to pass heavyweight objects by reference, instead of by copy. For...
Read more >
NET Performance Tips - .NET Framework
Explore performance tips to improve the execution speed of a program in .NET. See tips for boxing and unboxing, strings, and finalizers.
Read more >
5 Tips to Improve Performance of C# Code
5 Tips to improve performance of C# code. In this article, I show you 5 best practices of C# programming. I have learned...
Read more >
Find, Fix, and Avoid Performance Problems in C# .NET
This article will show 10 best practices on dealing with performance problems, starting with when you need to deal with them at all....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found