This repository has been archived by the owner on Aug 26, 2022. It is now read-only.
P# 1.6.0
This release contains the 1.6.0 version of the P# framework.
This is a major release containing new features and performance optimizations, as well as some minor API changes (to give us extra flexibility towards designing the below, but also planned upcoming features).
- Support for
MachineTestKit
, a new built-in unit-testing API that allows to test machines (and methods of machines) in isolation. You can learn more about this here. Done in #427. - Improved memory consumption (and reduced GCs) in production and testing by optimizing internal string (and some other types) allocations. In our microbenchmarks, the peak working set of some scenarios is cut by half (not taking into account user code of course). Done in #425.
- Improved messaging latency and throughput, by redesigning and optimizing the internal
Machine
inbox and its various operations. We are now implementing it internally using anIEventQueue
interface that allows us to inject different queues for different scenarios. Done in #426. - Support for running an
async Task
test (that uses theTest
attribute) withPSharpTester
. Done in #430.
Changes:
- The runtime type (returned by
PSharpRuntime.Create(…)
is now an interface of typeIMachineRuntime
. This allows us to modify the internal implementation without affecting the user by giving this interface. Event
has now an optional constructor that takes theGuid operationGroupId
(this was used to be passed via theSendOptions
optional parameter of theMachine.Send
method).Default
event cannot be manually instantiated anymore, useDefault.Event
to get a static instance. This improved memory consumption in machines that use theDefault
event.- The
ILogger
interface exposes a few new overloads ofWrite
andWriteLine
for reducing boxing and array creations (similar to thestring.Format
overloads). - The
OnWait
method of theILogger
interface has changed fromOnWait(MachineId machineId, string currStateName, string eventNames)
toOnWait(MachineId machineId, string currStateName, Type eventType)
andOnWait(MachineId machineId, string currStateName, params Type[] eventTypes)
. - Setting verbosity in the
PSharp.Configuration
has changed to a booleanIsVerbose
property. Similarly, from command line (e.g. usingPSharpTester
) you have to pass/v
instead of/v:N
. - Removed deprecated timer API, which was replaced by a redesigned timer API in
1.5.0
.