aboutsummaryrefslogtreecommitdiffstats
path: root/benchmark/vm_thread_pipe.yml
diff options
context:
space:
mode:
Diffstat (limited to 'benchmark/vm_thread_pipe.yml')
-rw-r--r--benchmark/vm_thread_pipe.yml20
1 files changed, 20 insertions, 0 deletions
diff --git a/benchmark/vm_thread_pipe.yml b/benchmark/vm_thread_pipe.yml
new file mode 100644
index 0000000000..fe4f3b8166
--- /dev/null
+++ b/benchmark/vm_thread_pipe.yml
@@ -0,0 +1,20 @@
+prelude: |
+ # Measure small and plenty pipe read/write.
+ # A performance may depend on GVL implementation.
+benchmark:
+ vm_thread_pipe: |
+
+ lmax = 100_000
+ r, w = IO.pipe
+ [Thread.new{
+ lmax.times{
+ w.write('a')
+ }
+ p "w:exit"
+ }, Thread.new{
+ lmax.times{
+ r.read(1)
+ }
+ p "r:exit"
+ }].each{|t| t.join}
+loop_count: 1