Skip to content
This repository was archived by the owner on May 7, 2024. It is now read-only.

Fix perf issue where main event loop takes 100% of CPU #132

Merged
merged 5 commits into from
Aug 17, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion mssqlscripter/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,9 @@ def main(args):
scripting_request.execute()

while not scripting_request.completed():
# The sleep prevents burning up the CPU and lets other threads get scheduled.
time.sleep(0.1)
response = scripting_request.get_response()

if response:
scriptercallbacks.handle_response(response, parameters.DisplayProgress)

Expand Down
15 changes: 4 additions & 11 deletions sql-xplat-cli.pyproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,13 @@
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{f4bb6290-43f3-4f35-b26e-067c5ef8e64b}</ProjectGuid>
<ProjectHome />
<StartupFile>build.py</StartupFile>
<StartupFile>mssqlscripter\main.py</StartupFile>
<SearchPath>.</SearchPath>
<WorkingDirectory>.</WorkingDirectory>
<OutputPath>.</OutputPath>
<ProjectTypeGuids>{888888a0-9f3d-457c-b088-3a5042f75d52}</ProjectTypeGuids>
<LaunchProvider>Standard Python launcher</LaunchProvider>
<InterpreterId>Global|PythonCore|2.7</InterpreterId>
<CommandLineArguments>
</CommandLineArguments>
<CommandLineArguments>-S localhost -d AdventureWorks2014</CommandLineArguments>
<EnableNativeCodeDebugging>False</EnableNativeCodeDebugging>
<IsWindowsApplication>False</IsWindowsApplication>
</PropertyGroup>
Expand All @@ -26,6 +24,7 @@
<Content Include=".gitignore" />
<Content Include="appveyor.yml" />
<Content Include="dev_requirements.txt" />
<Content Include="doc\README.md" />
<Content Include="doc\architecture_guide.md" />
<Content Include="doc\development_guide.md" />
<Content Include="doc\pypi_release_steps.md" />
Expand All @@ -49,9 +48,7 @@
<Content Include=".travis.yml" />
</ItemGroup>
<ItemGroup>
<Compile Include="build.py">
<SubType>Code</SubType>
</Compile>
<Compile Include="build.py" />
<Compile Include="dev_setup.py" />
<Compile Include="mssqlscripter\argparser.py" />
<Compile Include="mssqlscripter\jsonrpc\contracts\scriptingservice.py" />
Expand Down Expand Up @@ -89,9 +86,5 @@
<Folder Include="mssqltoolsservice\" />
<Folder Include="mssqltoolsservice\mssqltoolsservice\" />
</ItemGroup>
<ItemGroup>
<InterpreterReference Include="Global|PythonCore|2.7" />
<InterpreterReference Include="Global|PythonCore|3.6" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Python Tools\Microsoft.PythonTools.targets" />
</Project>
2 changes: 1 addition & 1 deletion sql-xplat-cli.sln
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ Global
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {1DD06426-BEB7-4299-B45E-04535B761301}
SolutionGuid = {1A0F24BB-2803-4A8C-9816-CB374FAAC673}
EndGlobalSection
EndGlobal