Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slowness on import caused by first line of Invoke-SqlCmd2.ps1 #8

Open
potatoqualitee opened this issue Feb 17, 2017 · 5 comments
Open

Comments

@potatoqualitee
Copy link
Member

image

@potatoqualitee
Copy link
Member Author

per @FriedrichWeinmann : Measure-Command { Get-Item function:\Invoke-Sqlcmd2 -ErrorAction Ignore }

image

@RamblingCookieMonster
Copy link
Collaborator

Strange! I can't seem to replicate this. It could be related to this, and I've seen AV add to this.

Any chance you could swap in Bartek's method for loading functions into the psm1 to see if this resolves the issue? Otherwise, I'm happy to just make the change (PR in dbatools dev branch, pull back here?)

On that note / aside, I'll open another issue on a process for automating that, if it makes sense:

  • dbatools appveyor job runs
  • tests run, if they pass...
  • clone this repo
  • replace invoke-sqlcmd.ps1, git add, git commit (re-use commit message from dbatools push), git push

SSH key or some other auth can be stored in AppVeyor secure variables, if you're comfortable with that. Or... AppVeyor might already be running with that permission? Not sure!

Cheers!

@FriedrichWeinmann
Copy link
Member

Hi Warren,
we already use that method of loading files. This delay on Get-Command happens, when the command isn't available only.
Cheers,
Fred

@RamblingCookieMonster
Copy link
Collaborator

Gotcha - I left in some cruft that might be slowing things down - removing the bit that searches a non-existent private folder cuts down the speed for me from 800ms to 100ms or so.

Still can't duplicate a two second delay though, could something else be in play on your system (anti-malware software, for example)?

@potatoqualitee
Copy link
Member Author

Hey Warren,
Not sure about the dela -- I use the default Microsoft malware stuff.

The appveyor thing sounds good :) Right now, I'm just putting it in the manual publish.ps1 that I have LOL.

Lemme know when that cruft has been removed (or where I can remove it) -- I'd love to include the speed up in the upcoming release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants