Comments (4)
Done @modery
from graphviz.netwrapper.
Could this be specific to starting processes in a winforms application?
When I reproduce your code in a unit test it prints:
Starting: 1/19/2024 2:19:40 PM
Finished: 1/19/2024 2:19:43 PM
And after removing the redundant calls to CreateLayout
:
Starting: 1/19/2024 2:20:19 PM
Finished: 1/19/2024 2:20:20 PM
I don't think we do anything exotic in this library, we just start a process and communicate over stdin/stdout. But since you mention you see a console window opening every call, there would likely be some additional overhead somewhere.
Sounds a bit like https://stackoverflow.com/questions/5377423/hide-console-window-from-process-start-c-sharp which recommends setting startInfo.UseShellExecute = false;
, but we already do that. Perhaps you could experiment with other options, like ProcessWindowStyle.Hidden
and see if that resolves your issue?
from graphviz.netwrapper.
I can confirm that running the same code in a console app takes 2 seconds (as expected).
Tested your suggestion, and added the Rubjerg.Graphviz and GraphvizWrapper projects to a test solution. Compiled as is (so same as 2.0.0), and the behaviour is the same (window pops up, generally it's slow).
Once I added the process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; to the relevant section in GraphvizCommand.Exec, the window didn't pop up again and generation was as fast as before
// Redirect the input/output streams
process.StartInfo.UseShellExecute = false;
process.StartInfo.RedirectStandardOutput = true;
process.StartInfo.RedirectStandardInput = true;
process.StartInfo.RedirectStandardError = true;
process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
Final test was doing the same thing in my actual program, and I can confirm that things worked well once the ProcessWindowStyle.Hidden was set
from graphviz.netwrapper.
Hi @chtenb , will you publish a new release for this? Preferably I wouldn't want to include your code in my own as a submodule, and rather simply use nuget (as I've been doing so far)
from graphviz.netwrapper.
Related Issues (20)
- Update the shipped DLLs to the newest GraphViz version HOT 1
- Feature Request: ToSvgFile overload HOT 2
- Change string marshaling to something crossplatform
- Change dot rendering to be done out-of-process
- Support different coordinate systems
- Switch to file-scoped namespaces
- Switch off using System.Drawing
- Splines() throws error when edge has tail arrows enabled
- Fix CodeCov integration
- Update main.yml
- The .NET 6 tests are failing silently on github actions
- .NET 6 tests give warnings on the stderr
- Support unicode
- Can't create SVG/PNG with space in folder path HOT 2
- Assembly.GetExecutingAssembly().Location is empty for self-contained (single file) apps HOT 2
- TestLayoutMethodsWithoutLayout is flaky
- Can't add an edge to a port - API only seems to support Nodes HOT 2
- Update graphviz version
- Update graphviz version
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from graphviz.netwrapper.