summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Frank <flori@ping.de>2009-11-07 23:57:25 +0100
committerFlorian Frank <flori@ping.de>2009-11-07 23:57:25 +0100
commit76e017a1b8a042bcb682b68821cc33f29788cd9a (patch)
tree07e14b66c1304e2dcabd7dacde71006204adde4b
parentf477a836f4f06de520d0e5de9adcf82c87fa69fb (diff)
downloadjson-76e017a1b8a042bcb682b68821cc33f29788cd9a.tar.gz
simplified build structure, tweak bs iterations
-rw-r--r--Rakefile40
-rwxr-xr-xbenchmarks/generator2_benchmark.rb8
-rwxr-xr-xbenchmarks/generator_benchmark.rb8
-rwxr-xr-xbenchmarks/parser2_benchmark.rb8
-rwxr-xr-xbenchmarks/parser_benchmark.rb8
-rw-r--r--ext/json/ext/extconf_generator.rb (renamed from ext/json/ext/generator/extconf.rb)0
-rw-r--r--ext/json/ext/extconf_parser.rb (renamed from ext/json/ext/parser/extconf.rb)0
-rw-r--r--ext/json/ext/generator.c (renamed from ext/json/ext/generator/generator.c)0
-rw-r--r--ext/json/ext/generator.h (renamed from ext/json/ext/generator/generator.h)0
-rw-r--r--ext/json/ext/parser.c (renamed from ext/json/ext/parser/parser.c)0
-rw-r--r--ext/json/ext/parser.h (renamed from ext/json/ext/parser/parser.h)0
-rw-r--r--ext/json/ext/parser.rl (renamed from ext/json/ext/parser/parser.rl)0
12 files changed, 35 insertions, 37 deletions
diff --git a/Rakefile b/Rakefile
index eead037..9fc0e76 100644
--- a/Rakefile
+++ b/Rakefile
@@ -9,31 +9,29 @@ rescue LoadError
puts "WARNING: rake-compiler is not installed. You will not be able to build the json gem until you install it."
end
-require 'rake/clean'
-CLOBBER.include Dir['benchmarks/data/*.{dat,log}']
-
require 'rbconfig'
include Config
+require 'rake/clean'
+CLOBBER.include Dir['benchmarks/data/*.{dat,log}']
+CLEAN.include FileList['diagrams/*.*'], 'doc', 'coverage', 'tmp',
+ FileList["ext/**/{Makefile,mkmf.log}"],
+ FileList["{ext,lib}/**/*.{so,bundle,#{CONFIG['DLEXT']},o,obj,pdb,lib,manifest,exp,def}"]
+
MAKE = ENV['MAKE'] || %w[gmake make].find { |c| system(c, '-v') }
PKG_NAME = 'json'
PKG_TITLE = 'JSON Implementation for Ruby'
PKG_VERSION = File.read('VERSION').chomp
PKG_FILES = FileList["**/*"].exclude(/CVS|pkg|tmp|coverage|Makefile|\.nfs\./).exclude(/\.(so|bundle|o|#{CONFIG['DLEXT']})$/)
EXT_ROOT_DIR = 'ext/json/ext'
-EXT_PARSER_DIR = "#{EXT_ROOT_DIR}/parser"
EXT_PARSER_DL = "#{EXT_ROOT_DIR}/parser.#{CONFIG['DLEXT']}"
-EXT_PARSER_SRC = "#{EXT_PARSER_DIR}/parser.c"
+EXT_PARSER_SRC = "#{EXT_ROOT_DIR}/parser.c"
PKG_FILES << EXT_PARSER_SRC
-EXT_GENERATOR_DIR = "#{EXT_ROOT_DIR}/generator"
EXT_GENERATOR_DL = "#{EXT_ROOT_DIR}/generator.#{CONFIG['DLEXT']}"
-EXT_GENERATOR_SRC = "#{EXT_GENERATOR_DIR}/generator.c"
+EXT_GENERATOR_SRC = "#{EXT_ROOT_DIR}/generator.c"
RAGEL_CODEGEN = %w[rlcodegen rlgen-cd ragel].find { |c| system(c, '-v') }
RAGEL_DOTGEN = %w[rlgen-dot rlgen-cd ragel].find { |c| system(c, '-v') }
-RAGEL_PATH = "#{EXT_PARSER_DIR}/parser.rl"
-CLEAN.include FileList['diagrams/*.*'], 'doc', 'coverage', 'tmp',
- FileList["ext/**/{Makefile,mkmf.log}"],
- FileList["{ext,lib}/**/*.{so,bundle,#{CONFIG['DLEXT']},o,obj,pdb,lib,manifest,exp,def}"]
+RAGEL_PATH = "#{EXT_ROOT_DIR}/parser.rl"
def myruby(*args, &block)
@myruby ||= File.join(CONFIG['bindir'], CONFIG['ruby_install_name'])
@@ -75,19 +73,17 @@ desc "Compiling extension"
task :compile_ext => [ EXT_PARSER_DL, EXT_GENERATOR_DL ]
file EXT_PARSER_DL => EXT_PARSER_SRC do
- cd EXT_PARSER_DIR do
- myruby 'extconf.rb'
+ cd EXT_ROOT_DIR do
+ myruby 'extconf_parser.rb'
sh MAKE
end
- cp "#{EXT_PARSER_DIR}/parser.#{CONFIG['DLEXT']}", EXT_ROOT_DIR
end
file EXT_GENERATOR_DL => EXT_GENERATOR_SRC do
- cd EXT_GENERATOR_DIR do
- myruby 'extconf.rb'
+ cd EXT_ROOT_DIR do
+ myruby 'extconf_generator.rb'
sh MAKE
end
- cp "#{EXT_GENERATOR_DIR}/generator.#{CONFIG['DLEXT']}", EXT_ROOT_DIR
end
desc "Generate parser with ragel"
@@ -98,7 +94,7 @@ task :ragel_clean do
end
file EXT_PARSER_SRC => RAGEL_PATH do
- cd EXT_PARSER_DIR do
+ cd EXT_ROOT_DIR do
if RAGEL_CODEGEN == 'ragel'
sh "ragel parser.rl -G2 -o parser.c"
else
@@ -217,7 +213,7 @@ if defined?(Gem) and defined?(Rake::GemPackageTask) and defined?(Rake::Extension
s.files = PKG_FILES
- s.extensions = FileList['ext/**/extconf.rb']
+ s.extensions = FileList['ext/**/extconf_*.rb']
s.require_path = EXT_ROOT_DIR
s.require_paths << 'ext'
@@ -246,19 +242,21 @@ if defined?(Gem) and defined?(Rake::GemPackageTask) and defined?(Rake::Extension
Rake::ExtensionTask.new do |ext|
ext.name = 'parser'
+ ext.config_script = 'extconf_parser.rb'
ext.gem_spec = spec_ext
ext.cross_compile = true
ext.cross_platform = 'i386-mswin32'
- ext.ext_dir = 'ext/json/ext/parser'
+ ext.ext_dir = 'ext/json/ext'
ext.lib_dir = 'lib/json/ext'
end
Rake::ExtensionTask.new do |ext|
ext.name = 'generator'
+ ext.config_script = 'extconf_generator.rb'
ext.gem_spec = spec_ext
ext.cross_compile = true
ext.cross_platform = 'i386-mswin32'
- ext.ext_dir = 'ext/json/ext/generator'
+ ext.ext_dir = 'ext/json/ext'
ext.lib_dir = 'lib/json/ext'
end
end
diff --git a/benchmarks/generator2_benchmark.rb b/benchmarks/generator2_benchmark.rb
index f253881..7b9fa74 100755
--- a/benchmarks/generator2_benchmark.rb
+++ b/benchmarks/generator2_benchmark.rb
@@ -65,7 +65,7 @@ class Generator2BenchmarkExt < Bullshit::RepeatCase
include JSONGeneratorCommon
warmup yes
- iterations 1000
+ iterations 8000
truncate_data do
enabled false
@@ -91,7 +91,7 @@ class Generator2BenchmarkPure < Bullshit::RepeatCase
include JSONGeneratorCommon
warmup yes
- iterations 1000
+ iterations 500
truncate_data do
enabled false
@@ -116,7 +116,7 @@ class Generator2BenchmarkRails < Bullshit::RepeatCase
include Generator2BenchmarkCommon
warmup yes
- iterations 1000
+ iterations 500
truncate_data do
enabled false
@@ -147,7 +147,7 @@ class Generator2BenchmarkYajl < Bullshit::RepeatCase
include Generator2BenchmarkCommon
warmup yes
- iterations 1000
+ iterations 8000
truncate_data do
enabled false
diff --git a/benchmarks/generator_benchmark.rb b/benchmarks/generator_benchmark.rb
index 281f443..9d6aec3 100755
--- a/benchmarks/generator_benchmark.rb
+++ b/benchmarks/generator_benchmark.rb
@@ -67,7 +67,7 @@ class GeneratorBenchmarkExt < Bullshit::RepeatCase
include JSONGeneratorCommon
warmup yes
- iterations 1000
+ iterations 8000
truncate_data do
enabled false
@@ -93,7 +93,7 @@ class GeneratorBenchmarkPure < Bullshit::RepeatCase
include JSONGeneratorCommon
warmup yes
- iterations 1000
+ iterations 500
truncate_data do
enabled false
@@ -118,7 +118,7 @@ class GeneratorBenchmarkRails < Bullshit::RepeatCase
include GeneratorBenchmarkCommon
warmup yes
- iterations 1000
+ iterations 500
truncate_data do
enabled false
@@ -149,7 +149,7 @@ class GeneratorBenchmarkYajl < Bullshit::RepeatCase
include GeneratorBenchmarkCommon
warmup yes
- iterations 1000
+ iterations 8000
truncate_data do
enabled false
diff --git a/benchmarks/parser2_benchmark.rb b/benchmarks/parser2_benchmark.rb
index b0a5b7e..bc80772 100755
--- a/benchmarks/parser2_benchmark.rb
+++ b/benchmarks/parser2_benchmark.rb
@@ -39,7 +39,7 @@ class Parser2BenchmarkExt < Bullshit::RepeatCase
include Parser2BenchmarkCommon
warmup yes
- iterations 1000
+ iterations 4000
truncate_data do
enabled false
@@ -70,7 +70,7 @@ class Parser2BenchmarkPure < Bullshit::RepeatCase
include Parser2BenchmarkCommon
warmup yes
- iterations 1000
+ iterations 500
truncate_data do
enabled false
@@ -134,7 +134,7 @@ end
class Parser2BenchmarkRails < Bullshit::RepeatCase
warmup yes
- iterations 1000
+ iterations 500
truncate_data do
alpha_level 0.05
@@ -170,7 +170,7 @@ end
class Parser2BenchmarkYajl < Bullshit::RepeatCase
warmup yes
- iterations 1000
+ iterations 4000
truncate_data do
alpha_level 0.05
diff --git a/benchmarks/parser_benchmark.rb b/benchmarks/parser_benchmark.rb
index 5fcef0a..acb8ea4 100755
--- a/benchmarks/parser_benchmark.rb
+++ b/benchmarks/parser_benchmark.rb
@@ -41,7 +41,7 @@ class ParserBenchmarkExt < Bullshit::RepeatCase
include ParserBenchmarkCommon
warmup yes
- iterations 1000
+ iterations 8000
truncate_data do
enabled false
@@ -72,7 +72,7 @@ class ParserBenchmarkPure < Bullshit::RepeatCase
include ParserBenchmarkCommon
warmup yes
- iterations 1000
+ iterations 500
truncate_data do
enabled false
@@ -138,7 +138,7 @@ end
class ParserBenchmarkRails < Bullshit::RepeatCase
warmup yes
- iterations 1000
+ iterations 500
truncate_data do
enabled false
@@ -175,7 +175,7 @@ end
class ParserBenchmarkYajl < Bullshit::RepeatCase
warmup yes
- iterations 1000
+ iterations 8000
truncate_data do
enabled false
diff --git a/ext/json/ext/generator/extconf.rb b/ext/json/ext/extconf_generator.rb
index 33a5625..33a5625 100644
--- a/ext/json/ext/generator/extconf.rb
+++ b/ext/json/ext/extconf_generator.rb
diff --git a/ext/json/ext/parser/extconf.rb b/ext/json/ext/extconf_parser.rb
index 9662e9a..9662e9a 100644
--- a/ext/json/ext/parser/extconf.rb
+++ b/ext/json/ext/extconf_parser.rb
diff --git a/ext/json/ext/generator/generator.c b/ext/json/ext/generator.c
index 1db22a7..1db22a7 100644
--- a/ext/json/ext/generator/generator.c
+++ b/ext/json/ext/generator.c
diff --git a/ext/json/ext/generator/generator.h b/ext/json/ext/generator.h
index 5b5a28c..5b5a28c 100644
--- a/ext/json/ext/generator/generator.h
+++ b/ext/json/ext/generator.h
diff --git a/ext/json/ext/parser/parser.c b/ext/json/ext/parser.c
index 0122571..0122571 100644
--- a/ext/json/ext/parser/parser.c
+++ b/ext/json/ext/parser.c
diff --git a/ext/json/ext/parser/parser.h b/ext/json/ext/parser.h
index 5f2506d..5f2506d 100644
--- a/ext/json/ext/parser/parser.h
+++ b/ext/json/ext/parser.h
diff --git a/ext/json/ext/parser/parser.rl b/ext/json/ext/parser.rl
index b91ac00..b91ac00 100644
--- a/ext/json/ext/parser/parser.rl
+++ b/ext/json/ext/parser.rl