Skip to content
This repository has been archived by the owner on May 4, 2024. It is now read-only.

Support TappingDevice::Device#stop_when #4

Merged
merged 2 commits into from
Nov 1, 2019
Merged

Conversation

st0012
Copy link
Owner

@st0012 st0012 commented Nov 1, 2019

The biggest issue tapping_device has is about performance. This is because TracePoint literally taps every method call on every object if nothing disables it. So using tapping_device on a large application with multiple tappings can be extremely slow or even hang your application.

This PR tries to solve this issue by:

  1. Adding TappingDevice::Device#stop_when to let users add stop condition. Once the block evaluation returns anything truthy, the tapping would be stopped.

  2. Adding tap_init, tap_on and tap_assoc methods, which will first check if stop_when condition is provided and raise exception if not.

@st0012 st0012 added this to the v0.1.2 milestone Nov 1, 2019
@st0012 st0012 self-assigned this Nov 1, 2019
The biggest issue `tapping_device` has is about performance. Because
TracePoint literally taps every method call on every object if nothing
disable it. So using `tapping_device` on large application with multiple
tappings can be extremely slow or even hang your application.

This commit tries to solve this issue by:

1. Adding `TappingDevice::Device#stop_when` to let users add stop
condition. Once the block evaluation returns anything truthy, the
tapping would be stopped.

2. Adding `tap_init`, `tap_on` and `tap_assoc` methods, which will first
check if `stop_when` condition is provided and raise exception if not.
@st0012 st0012 merged commit 7c3379d into master Nov 1, 2019
@st0012 st0012 deleted the require-stop-condition branch November 1, 2019 07:56
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant