Sha256: 96f0f893d8c5ec5904f99ea8aacb59ade5af0c55703a00498cd38f55d742b422

Contents?: true

Size: 838 Bytes

Versions: 4

Compression:

Stored size: 838 Bytes

Contents

require File.expand_path(File.join(File.dirname(__FILE__), '..', 'test_helper.rb'))

class BenchmarkTest < Test::Unit::TestCase

  require 'benchmark'

  test "benchmark sexpistol" do
    puts "\nRunning performance test...\n"
    parser = Sexpistol.new
    parser.ruby_keyword_literals = true
    Benchmark.bmbm do |b|
      b.report do
        5000.times do
          parser.parse_string <<-EOD
          
            (display "This is a test string!")
            
            (define test (lambda () (begin
              (display (== 1 1))
              (display (== true true))
              (display (== false false))
              (display (== nil nil))
              (display (== 2.09 1.08))
              (display (== 2e6 2e12))
            )))
            
          EOD
        end
      end
    end
    puts
  end    
    
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
sexpistol-0.0.6 test/performance/benchmark_test.rb
sexpistol-0.0.5 test/performance/benchmark_test.rb
sexpistol-0.0.4 test/performance/benchmark_test.rb
sexpistol-0.0.3 test/performance/benchmark_test.rb