Performance Considerations for the StylusInput API

The following list describes some ways in which to improve the performance of applications that use the StylusInput APIs.

  • Use the Microsoft.StylusInput.IStylusSyncPlugin.DataInterest or Microsoft.StylusInput.IStylusAsyncPlugin.DataInterest property to subscribe only to the data that is relevant to your plug-in. This reduces the overall number of method calls the RealTimeStylus object makes and also reduces the complexity of your plug-in. The RealTimeStylus object only checks the DataInterest property when the plug-in is attached.
  • Minimize the complexity of synchronous plug-ins. Synchronous plug-ins generally called by the RealTimeStylus object's thread and may contribute to delays in ink collection.
  • Consider making your plug-in asynchronous. If your plug-in is complex and needs to add custom data to the RealTimeStylus object's queue, consider using a cascaded RealTimeStylus model and adding the plug-in to the secondary RealTimeStylus object's synchronous plug-in collection. For more information about the cascaded RealTimeStylus model, see The Cascaded RealTimeStylus Model.