New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

automatthew-stevedore

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

automatthew-stevedore

  • 0.2.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Stevedore is a tool for performing and comparing sets of benchmarks based on similar setup and teardown needs. Instances use their class's setup/teardown where available, and you can set or override these methods per instance.

Steve (and his subclasses, naturally) track any instances created and can run a comparison using Steve.compare_instances. If the R language is available, you can do a power analysis using the data from a trial run to suggest sample sizes and number of runs needed to meet certain figures of statistical reliability.

Steve uses the rsruby gem, if available, for basic stats and power analysis. As the rsruby gem uses a C extension, this could be problematic for non-MRI Rubys. In the absence of rsruby, stevedore uses bmarini-mathstats for the basic stats and attempts to shell out to R for power analysis (i.e. power.t.test)

class StringConcat < Stevedore before_sample do ... end after_sample do ... end end

plus = StringConcat.new "Combining strings with +" do measure do 10000.times do "supercalifragilisticexpiali" + "docious" end end end

append = StringConcat.new "Combining strings with <<" do measure do 10000.times do "supercalifragilisticexpiali" << "docious" end end end

interpolate = StringConcat.new "Combining strings with interpolation" do measure do 10000.times do "supercalifragilisticexpiali#{'docious'}" end end end

run_count, sample_size = 3, 8

puts "Measuring #{run_count} runs of #{sample_size} for each test." StringConcat.run([append, interpolate], run_count, sample_size) puts StringConcat.report([append, interpolate]) => putses the following:

Combining strings

                            Mean       Stddev      Minimum       Median          Max

interpolating strings 0.003064 0.002386 0.001356 0.001682 0.008544 appending strings 0.009267 0.002933 0.005337 0.010756 0.013299 Ratio of means: 3.02487110476993

FAQs

Package last updated on 11 Aug 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc