Comments (5)
@NikolajBjorner Is my understanding of this line correct that Z3.Context
in the high-level API deletes the context itself, so that we don't have to call Z3.del_context(ctx)
externally?
from z3guide.
I asked because we always called Z3.del_context(ctx)
when handling web-based executions for the SMITLIB format (see this line in runZ3Web.ts
), but not in runZ3JSWeb.ts
, where we call evalZ3JS()
from eval-z3.ts
that @bakkot provided. The evalZ3JS()
call does not delete the context after calling eval()
, so I doubt whether this is causing the dangling webworkers for JS examples.
from z3guide.
To replicate in Chrome (which lets you see the number of dedicated workers in Task Manager):
- Go to
Playground
, where a SMTLIB example is hosted. Click "Run" twice (to get the web-computed output instead of the pre-computed output). You see one webworker. - Go to some other SMTLIB code snippet and click "Run" twice to get the web-computed output, you still see one webworker, no matter how many more times you click.
- Now go to some JS example in the "Programming Z3" section. Click "Run" twice to get the web-computed output, you see TWO webworkers, where the new one was added for the JS example.
- Go to another JS example, click "Run" twice, and you see THREE webworkers, where the last two dedicated for executions of the two JS snippets, respectively.
I would expect for one or maybe two webworkers at most for the web-based executions, one handling the SMTLIB examples and the other handling the JS examples. It looks like we are creating a new webworker every time we run one new JS snippet, which is problematic.
from z3guide.
The webworkers actually never get killed by anything, but there's a bounded number. Normally they'd go away when you navigate to a new page, but the docusaurus site appears to not be doing a "soft" navigation, where it just loads the content for the new page and changes the URL without doing an actual navigation (which would kill the existing webworkers).
Given that, you shouldn't be able to make more than 3 workers, I think - 1 for the SMTLIB examples, 2 for the JS examples (though I don't know why it's 2 rather than 1). In particular, I am pretty sure it's not making a new one every time you evaluate a JS snippet, at least in my testing.
from z3guide.
Thanks for the quick response. It is indeed capped at 3 for JS examples. In that case I think we should be fine...? I mean people can always refresh the page to clear out the queue of webworkers.
from z3guide.
Related Issues (20)
- Funky cursor position HOT 1
- local yarn and finding z3-solver HOT 2
- Line numbers beyond 100 HOT 1
- copy over parameters
- new playground as a standalone top-level section HOT 1
- homepage buttons
- error reporting for formula guessing
- timeout for SMTLIB strings
- SMTLIB examples render old output when the new input runs but has an empty output HOT 1
- disable editing on mobile HOT 2
- differentiating timeout vs unknown error
- Missing glossary HOT 2
- Workshop-discovered text nits HOT 1
- Suggestion: introducing fuzzy-search *OR* adding links to the footer πππ¦ΆπΌ
- C# examples HOT 1
- syntax highlighting of smt samples in readonly blocks
- Updating to z3-solver version 4.12.0 breaks when evaluating js HOT 9
- TotalLinearOrder -> LinearOrder HOT 1
- Missing links on BitVectors site
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 z3guide.