Linux iad1-shared-b7-18 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
Apache
: 67.205.6.31 | : 216.73.216.13
Cant Read [ /etc/named.conf ]
8.2.29
fernandoquevedo
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
README
+ Create Folder
+ Create File
/
usr /
share /
doc /
ruby-concurrent /
examples /
[ HOME SHELL ]
Name
Size
Permission
Action
a-tour-of-go-channels
[ DIR ]
drwxr-xr-x
go-by-example-channels
[ DIR ]
drwxr-xr-x
actor_stress_test.rb
3.23
KB
-rwxr-xr-x
atomic_example.rb
392
B
-rwxr-xr-x
benchmark_async.rb
6.81
KB
-rwxr-xr-x
benchmark_atomic.rb
2.53
KB
-rwxr-xr-x
benchmark_atomic_1.rb
2.52
KB
-rwxr-xr-x
benchmark_atomic_boolean.rb
984
B
-rwxr-xr-x
benchmark_atomic_fixnum.rb
964
B
-rwxr-xr-x
benchmark_map.rb
581
B
-rwxr-xr-x
benchmark_new_futures.rb
2.16
KB
-rwxr-xr-x
benchmark_read_write_lock.rb
4.27
KB
-rwxr-xr-x
benchmark_structs.rb
4.66
KB
-rwxr-xr-x
format.rb
1.86
KB
-rw-r--r--
graph_atomic_bench.rb
1.73
KB
-rwxr-xr-x
init.rb
104
B
-rw-r--r--
stress_ruby_thread_pool.rb
791
B
-rwxr-xr-x
thread_local_memory_usage.rb
1.61
KB
-rwxr-xr-x
thread_local_var_bench.rb
606
B
-rwxr-xr-x
who.rb
711
B
-rwxr-xr-x
Delete
Unzip
Zip
${this.title}
Close
Code Editor : benchmark_new_futures.rb
#!/usr/bin/env ruby require 'benchmark/ips' require 'concurrent' require 'concurrent-edge' raise 'concurrent-ext not loaded' if Concurrent.on_cruby? && Concurrent.c_extensions_loaded? scale = 1 time = 10 * scale warmup = 2 * scale warmup *= 10 if Concurrent.on_jruby? Benchmark.ips(time, warmup) do |x| x.report('flat-old') do Concurrent::Promise.execute { 1 }.flat_map { |v| Concurrent::Promise.execute { v + 2 } }.value! end x.report('flat-new') do Concurrent::Promises.future(:fast) { 1 }.then { |v| Concurrent::Promises.future(:fast) { v + 2 } }.flat.value! end x.compare! end Benchmark.ips(time, warmup) do |x| x.report('status-old') { f = Concurrent::Promise.execute { nil }; 100.times { f.complete? } } x.report('status-new') { f = Concurrent::Promises.future(:fast) { nil }; 100.times { f.resolved? } } x.compare! end Benchmark.ips(time, warmup) do |x| of = Concurrent::Promise.execute { 1 } nf = Concurrent::Promises.fulfilled_future(1, :fast) x.report('value-old') { of.value! } x.report('value-new') { nf.value! } x.compare! end Benchmark.ips(time, warmup) do |x| x.report('graph-old') do head = Concurrent::Promise.fulfill(1) 10.times do branch1 = head.then(&:succ) branch2 = head.then(&:succ).then(&:succ) head = Concurrent::Promise.zip(branch1, branch2).then { |a, b| a + b } end head.value! end x.report('graph-new') do head = Concurrent::Promises.fulfilled_future(1, :fast) 10.times do branch1 = head.then(&:succ) branch2 = head.then(&:succ).then(&:succ) head = (branch1 & branch2).then { |a, b| a + b } end head.value! end x.compare! end Benchmark.ips(time, warmup) do |x| x.report('immediate-old') { Concurrent::Promise.fulfill(nil).value! } x.report('immediate-new') { Concurrent::Promises.fulfilled_future(nil, :fast).value! } x.compare! end Benchmark.ips(time, warmup) do |x| of = Concurrent::Promise.execute { 1 } nf = Concurrent::Promises.fulfilled_future(1, :fast) x.report('then-old') { 50.times.reduce(of) { |nf, _| nf.then(&:succ) }.value! } x.report('then-new') { 50.times.reduce(nf) { |nf, _| nf.then(&:succ) }.value! } x.compare! end
Close