Comments (4)
Without quoting...
- As far as I've tested it, yes,
-fast
is much faster than-safe
. Around an order of magnitude (minutes -> seconds) on Oml and Ketrew. I think the-safe
is mostly legacy, I've kept it around for backward compatibility. I've never found an instance where they diverged, but I've only spot checked the test suite and the projects where I've applied the switch. If you want to just have one mode that is canonical and "just works", I am all in favor of jettisoning-safe
and changing-faster.
- A performance test is a good idea, but not required. The improvement is noticeable.
- A race condition test is probably a good idea, we had a bug dealing with
OUnit
threads a couple of months ago. - I don't know how people use the Bisect_ppx counts. I think of this as a library to help in testing infrastructure, so I don't think of it as being that performance critical, but having accurate counts as being more valuable. One certainly would want to know if a count is not what you expect (which just might be zero). My preference would be for just one mode that does the counting correctly and get rid of the different modes entirely, ie your
-numeric
. Perhaps we can keep the-fast
mode but with separate arrays (that are created as needed) per thread, to avoid the blocking. I don't know too much aboutocaml.ppx.context
from bisect_ppx.
I agree with your preference.
The one mode should be the current -faster
, i.e. per-module arrays and no locks. We can maintain the other flags and just ignore them. Here is why:
Relative to current OCaml:
- There is no pre-emption AFAICT in bytecode or native code unless you allocate or do I/O, so
-faster
and-fast
are inherently thread-safe. Ironically,-safe
is the only mode that was ever unsafe, but only if you have a large number of points and have to resize arrays (haven't verified this). - I think this is true no matter what libraries or configurations you are using.
Relative to future OCaml:
- I need to read up on this, but I think multicore will allow concurrent execution of our counting code, but still will not allow pre-emption of a thread that is already running on a core during count update. Then, as long as multicore also provides atomic compare-and-exchange, we should be able to wrap counts in spin locks, or find another method of fast mutual exclusion. Then, we should be able to make the code always thread-safe in one mode without a significant performance hit.
- In any case, we don't know exactly what there will be so I think we shouldn't try to solve this now.
- On the other hand, we are well prepared to solve it quickly when it's time, since we will have this experience and the thread safety test.
from bisect_ppx.
Reasonable.
from bisect_ppx.
Actually, it occurs to me that running on ocamljava probably requires the locks, though I am not sure if it worked there, since BisectThread
required Mutex
, and I don't see Mutex
in any of the docs. Thoughts?
from bisect_ppx.
Related Issues (20)
- Update ReScript example repo HOT 1
- Link to CS3110 tutorial + video on Bisect_ppx
- Cannot install with pnpm HOT 1
- Type errors when building with BISECT_ENABLE HOT 13
- Gracefully handling termination in instrumented binaries HOT 10
- Make sure bisect-ppx-report handles corrupted coverage files gracefully HOT 12
- Better error message on missing files HOT 4
- Coverage position misplacement in module HOT 8
- Utility to merge coverage files HOT 4
- Coverage statistics based on every source file HOT 6
- Compare coverages HOT 4
- Random: add or tweak reporter themes
- Invalid cobertura report HOT 8
- Semantic of `Lazy.is_val` changes using `bisect_ppx` HOT 3
- Confused about excluding/linking coverage files with Melange+Dune HOT 4
- Can't Install Fresh Clone HOT 2
- ReasonML support seems to be broken... HOT 1
- cannot advance to `rescript` `10` HOT 1
- Does not seem to instrument cram-style tests HOT 1
- `bisect_ppx` doesn't see the instrumentation clause in my library HOT 4
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 bisect_ppx.