opal 0.8.1 → 0.9.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -2
- data/.gitmodules +3 -3
- data/.jshintrc +17 -20
- data/.travis.yml +22 -11
- data/CHANGELOG.md +51 -1
- data/CODE_OF_CONDUCT.md +15 -0
- data/CONTRIBUTING.md +125 -9
- data/Gemfile +1 -1
- data/Guardfile +2 -2
- data/README.md +95 -29
- data/Rakefile +1 -1
- data/benchmark/benchmarks +103 -0
- data/benchmark/bm_array_flatten.rb +9 -0
- data/benchmark/bm_array_intersection_numbers.rb +7 -0
- data/benchmark/bm_array_intersection_objects.rb +7 -0
- data/benchmark/bm_array_intersection_strings.rb +7 -0
- data/benchmark/bm_array_join_ary.rb +9 -0
- data/benchmark/bm_array_minus_numbers.rb +7 -0
- data/benchmark/bm_array_minus_objects.rb +7 -0
- data/benchmark/bm_array_minus_strings.rb +7 -0
- data/benchmark/bm_array_union_numbers.rb +7 -0
- data/benchmark/bm_array_union_objects.rb +7 -0
- data/benchmark/bm_array_union_strings.rb +7 -0
- data/benchmark/bm_array_uniq_bang_numbers.rb +5 -0
- data/benchmark/bm_array_uniq_bang_objects.rb +5 -0
- data/benchmark/bm_array_uniq_bang_strings.rb +5 -0
- data/benchmark/bm_array_uniq_numbers.rb +5 -0
- data/benchmark/bm_array_uniq_objects.rb +5 -0
- data/benchmark/bm_array_uniq_strings.rb +5 -0
- data/benchmark/bm_dispatch_bind_table.rb +57 -0
- data/benchmark/bm_dispatch_code_gen.rb +65 -0
- data/benchmark/bm_dispatch_code_gen_if.rb +64 -0
- data/benchmark/bm_dispatch_hardcoded.rb +44 -0
- data/benchmark/bm_dispatch_send.rb +38 -0
- data/benchmark/bm_dispatch_send_table.rb +57 -0
- data/benchmark/bm_hash_assoc_object.rb +11 -0
- data/benchmark/bm_hash_assoc_string.rb +9 -0
- data/benchmark/bm_hash_clone_object.rb +9 -0
- data/benchmark/bm_hash_clone_string.rb +9 -0
- data/benchmark/bm_hash_delete_object.rb +11 -0
- data/benchmark/bm_hash_delete_string.rb +9 -0
- data/benchmark/bm_hash_each_key_object.rb +9 -0
- data/benchmark/bm_hash_each_key_string.rb +9 -0
- data/benchmark/bm_hash_each_object.rb +9 -0
- data/benchmark/bm_hash_each_string.rb +9 -0
- data/benchmark/bm_hash_each_value_object.rb +9 -0
- data/benchmark/bm_hash_each_value_string.rb +9 -0
- data/benchmark/bm_hash_element_reference_object.rb +11 -0
- data/benchmark/bm_hash_element_reference_string.rb +9 -0
- data/benchmark/bm_hash_element_set_object.rb +5 -0
- data/benchmark/bm_hash_element_set_string.rb +5 -0
- data/benchmark/bm_hash_equal_value_object.rb +14 -0
- data/benchmark/bm_hash_equal_value_string.rb +11 -0
- data/benchmark/bm_hash_fetch_object.rb +11 -0
- data/benchmark/bm_hash_fetch_string.rb +9 -0
- data/benchmark/bm_hash_flatten_object.rb +9 -0
- data/benchmark/bm_hash_flatten_string.rb +9 -0
- data/benchmark/bm_hash_has_key_object.rb +11 -0
- data/benchmark/bm_hash_has_key_string.rb +9 -0
- data/benchmark/bm_hash_has_value_object.rb +9 -0
- data/benchmark/bm_hash_has_value_string.rb +9 -0
- data/benchmark/bm_hash_hash_object.rb +9 -0
- data/benchmark/bm_hash_hash_string.rb +9 -0
- data/benchmark/bm_hash_inspect_object.rb +9 -0
- data/benchmark/bm_hash_inspect_string.rb +9 -0
- data/benchmark/bm_hash_invert_object.rb +9 -0
- data/benchmark/bm_hash_invert_string.rb +9 -0
- data/benchmark/bm_hash_keep_if_object.rb +9 -0
- data/benchmark/bm_hash_keep_if_string.rb +9 -0
- data/benchmark/bm_hash_key_object.rb +9 -0
- data/benchmark/bm_hash_key_string.rb +9 -0
- data/benchmark/bm_hash_keys_object.rb +9 -0
- data/benchmark/bm_hash_keys_string.rb +9 -0
- data/benchmark/bm_hash_literal_mixed_large.rb +3 -0
- data/benchmark/bm_hash_literal_mixed_small.rb +3 -0
- data/benchmark/bm_hash_literal_object_large.rb +4 -0
- data/benchmark/bm_hash_literal_object_small.rb +3 -0
- data/benchmark/bm_hash_literal_string_large.rb +4 -0
- data/benchmark/bm_hash_literal_string_small.rb +3 -0
- data/benchmark/bm_hash_merge_object.rb +22 -0
- data/benchmark/bm_hash_merge_string.rb +18 -0
- data/benchmark/bm_hash_rassoc_object.rb +9 -0
- data/benchmark/bm_hash_rassoc_string.rb +9 -0
- data/benchmark/bm_hash_rehash_object.rb +9 -0
- data/benchmark/bm_hash_rehash_string.rb +9 -0
- data/benchmark/bm_hash_reject_bang_object.rb +9 -0
- data/benchmark/bm_hash_reject_bang_string.rb +9 -0
- data/benchmark/bm_hash_reject_object.rb +9 -0
- data/benchmark/bm_hash_reject_string.rb +9 -0
- data/benchmark/bm_hash_replace_object.rb +18 -0
- data/benchmark/bm_hash_replace_string.rb +14 -0
- data/benchmark/bm_hash_select_bang_object.rb +9 -0
- data/benchmark/bm_hash_select_bang_string.rb +9 -0
- data/benchmark/bm_hash_select_object.rb +9 -0
- data/benchmark/bm_hash_select_string.rb +9 -0
- data/benchmark/bm_hash_shift_object.rb +10 -0
- data/benchmark/bm_hash_shift_string.rb +10 -0
- data/benchmark/bm_hash_to_a_object.rb +9 -0
- data/benchmark/bm_hash_to_a_string.rb +9 -0
- data/benchmark/bm_hash_to_h_object.rb +10 -0
- data/benchmark/bm_hash_to_h_string.rb +10 -0
- data/benchmark/bm_hash_values_object.rb +9 -0
- data/benchmark/bm_hash_values_string.rb +9 -0
- data/benchmark/run.rb +48 -0
- data/bin/opal-mspec +1 -1
- data/bin/opal-repl +4 -4
- data/docs/compiled_ruby.md +214 -56
- data/docs/configuring_gems.md +2 -2
- data/docs/faq.md +2 -2
- data/docs/getting_started.md +19 -2
- data/docs/jquery.md +5 -5
- data/docs/opal_parser.md +53 -0
- data/docs/unsupported_features.md +2 -2
- data/docs/upgrading.md +22 -0
- data/docs/using_sprockets.md +15 -0
- data/examples/rack/config.ru +13 -0
- data/examples/sinatra/config.ru +4 -5
- data/lib/mspec/opal/runner.rb +54 -11
- data/lib/opal.rb +1 -1
- data/lib/opal/builder.rb +1 -1
- data/lib/opal/builder_processors.rb +1 -1
- data/lib/opal/cli.rb +17 -13
- data/lib/opal/cli_options.rb +1 -1
- data/lib/opal/compiler.rb +12 -0
- data/lib/opal/config.rb +4 -0
- data/lib/opal/nodes/arglist.rb +5 -7
- data/lib/opal/nodes/call.rb +6 -1
- data/lib/opal/nodes/call_special.rb +74 -0
- data/lib/opal/nodes/def.rb +35 -28
- data/lib/opal/nodes/definitions.rb +3 -5
- data/lib/opal/nodes/for.rb +13 -0
- data/lib/opal/nodes/helpers.rb +15 -1
- data/lib/opal/nodes/if.rb +5 -5
- data/lib/opal/nodes/iter.rb +6 -1
- data/lib/opal/nodes/literal.rb +1 -1
- data/lib/opal/nodes/logic.rb +2 -2
- data/lib/opal/nodes/masgn.rb +1 -2
- data/lib/opal/nodes/module.rb +2 -1
- data/lib/opal/nodes/rescue.rb +10 -1
- data/lib/opal/nodes/scope.rb +8 -2
- data/lib/opal/nodes/singleton_class.rb +1 -1
- data/lib/opal/nodes/top.rb +11 -0
- data/lib/opal/nodes/variables.rb +4 -4
- data/lib/opal/parser.rb +21 -3
- data/lib/opal/parser/grammar.rb +3115 -2961
- data/lib/opal/parser/grammar.y +29 -6
- data/lib/opal/parser/lexer.rb +18 -8
- data/lib/opal/sprockets.rb +85 -0
- data/lib/opal/sprockets/processor.rb +11 -35
- data/lib/opal/sprockets/server.rb +3 -15
- data/lib/opal/version.rb +2 -2
- data/opal.gemspec +4 -4
- data/opal/README.md +9 -0
- data/opal/corelib/array.rb +433 -181
- data/opal/corelib/basic_object.rb +48 -4
- data/opal/corelib/boolean.rb +15 -6
- data/opal/corelib/class.rb +6 -5
- data/opal/corelib/comparable.rb +12 -0
- data/opal/corelib/complex.rb +282 -0
- data/opal/corelib/constants.rb +9 -0
- data/opal/corelib/enumerable.rb +83 -34
- data/opal/corelib/enumerator.rb +3 -1
- data/opal/corelib/error.rb +49 -10
- data/opal/corelib/file.rb +1 -0
- data/opal/corelib/hash.rb +353 -577
- data/opal/corelib/helpers.rb +20 -0
- data/opal/corelib/kernel.rb +114 -59
- data/opal/corelib/math.rb +470 -0
- data/opal/corelib/method.rb +11 -2
- data/opal/corelib/module.rb +96 -96
- data/opal/corelib/{nil_class.rb → nil.rb} +20 -1
- data/opal/corelib/number.rb +751 -0
- data/opal/corelib/numeric.rb +77 -437
- data/opal/corelib/proc.rb +81 -1
- data/opal/corelib/process.rb +27 -0
- data/opal/corelib/rational.rb +358 -0
- data/opal/corelib/regexp.rb +156 -27
- data/opal/corelib/runtime.js +724 -335
- data/opal/corelib/string.rb +93 -104
- data/opal/corelib/string/encoding.rb +177 -0
- data/opal/corelib/string/inheritance.rb +2 -0
- data/opal/corelib/struct.rb +105 -18
- data/opal/corelib/time.rb +267 -146
- data/opal/corelib/unsupported.rb +216 -0
- data/opal/corelib/variables.rb +0 -6
- data/opal/opal.rb +8 -22
- data/opal/opal/base.rb +9 -0
- data/opal/opal/mini.rb +17 -0
- data/spec/README.md +1 -1
- data/spec/filters/bugs/array.rb +38 -136
- data/spec/filters/bugs/{basic_object.rb → basicobject.rb} +14 -15
- data/spec/filters/bugs/class.rb +6 -12
- data/spec/filters/bugs/complex.rb +3 -0
- data/spec/filters/bugs/date.rb +162 -10
- data/spec/filters/bugs/enumerable.rb +31 -58
- data/spec/filters/bugs/enumerator.rb +42 -0
- data/spec/filters/bugs/exception.rb +66 -10
- data/spec/filters/bugs/float.rb +17 -0
- data/spec/filters/bugs/hash.rb +11 -97
- data/spec/filters/bugs/inheritance.rb +5 -0
- data/spec/filters/bugs/integer.rb +28 -0
- data/spec/filters/bugs/kernel.rb +304 -12
- data/spec/filters/bugs/language.rb +133 -399
- data/spec/filters/bugs/language_opal.rb +88 -0
- data/spec/filters/bugs/module.rb +203 -62
- data/spec/filters/bugs/numeric.rb +32 -0
- data/spec/filters/bugs/proc.rb +39 -0
- data/spec/filters/bugs/range.rb +148 -0
- data/spec/filters/bugs/regexp.rb +168 -0
- data/spec/filters/bugs/set.rb +46 -3
- data/spec/filters/bugs/singleton.rb +1 -2
- data/spec/filters/bugs/string.rb +59 -90
- data/spec/filters/bugs/strscan.rb +80 -0
- data/spec/filters/bugs/struct.rb +10 -20
- data/spec/filters/bugs/time.rb +17 -184
- data/spec/filters/bugs/unboundmethod.rb +22 -0
- data/spec/filters/unsupported/array.rb +163 -0
- data/spec/filters/unsupported/basicobject.rb +14 -0
- data/spec/filters/unsupported/bignum.rb +46 -0
- data/spec/filters/unsupported/class.rb +4 -0
- data/spec/filters/unsupported/delegator.rb +5 -0
- data/spec/filters/unsupported/enumerable.rb +11 -0
- data/spec/filters/unsupported/enumerator.rb +8 -9
- data/spec/filters/unsupported/fixnum.rb +14 -0
- data/spec/filters/unsupported/float.rb +41 -7
- data/spec/filters/unsupported/freeze.rb +45 -0
- data/spec/filters/unsupported/hash.rb +50 -0
- data/spec/filters/unsupported/integer.rb +3 -0
- data/spec/filters/unsupported/kernel.rb +31 -0
- data/spec/filters/unsupported/language.rb +17 -0
- data/spec/filters/unsupported/matchdata.rb +30 -0
- data/spec/filters/unsupported/math.rb +3 -0
- data/spec/filters/unsupported/module.rb +5 -3
- data/spec/filters/unsupported/pathname.rb +3 -0
- data/spec/filters/unsupported/privacy.rb +136 -0
- data/spec/filters/unsupported/proc.rb +3 -0
- data/spec/filters/unsupported/regexp.rb +59 -0
- data/spec/filters/unsupported/set.rb +4 -0
- data/spec/filters/unsupported/{marshal.rb → singleton.rb} +4 -2
- data/spec/filters/unsupported/{mutable_strings.rb → string.rb} +456 -336
- data/spec/filters/unsupported/struct.rb +3 -0
- data/spec/filters/unsupported/symbol.rb +5 -0
- data/spec/filters/unsupported/taint.rb +16 -0
- data/spec/filters/unsupported/thread.rb +5 -0
- data/spec/filters/unsupported/time.rb +197 -16
- data/spec/lib/cli_spec.rb +14 -4
- data/spec/lib/compiler_spec.rb +9 -1
- data/spec/lib/parser/call_spec.rb +18 -0
- data/spec/lib/parser/not_spec.rb +2 -8
- data/spec/lib/sprockets_spec.rb +24 -0
- data/spec/opal/core/array/intersection_spec.rb +38 -0
- data/spec/opal/core/array/minus_spec.rb +38 -0
- data/spec/opal/core/array/union_spec.rb +38 -0
- data/spec/opal/core/array/uniq_spec.rb +49 -0
- data/spec/opal/core/exception_spec.rb +7 -0
- data/spec/opal/core/fixtures/require_tree_with_dot/file 1.rb +1 -0
- data/spec/opal/core/fixtures/require_tree_with_dot/file 2.rb +1 -0
- data/spec/opal/core/fixtures/require_tree_with_dot/file 3.rb +1 -0
- data/spec/opal/core/fixtures/require_tree_with_dot/index.rb +3 -0
- data/spec/opal/core/hash/internals_spec.rb +332 -0
- data/spec/opal/core/helpers_spec.rb +14 -0
- data/spec/opal/core/kernel/freeze_spec.rb +1 -1
- data/spec/opal/core/kernel/raise_spec.rb +13 -0
- data/spec/opal/core/kernel/require_tree_spec.rb +9 -0
- data/spec/opal/core/language/class_spec.rb +55 -0
- data/spec/opal/core/language/fixtures/send.rb +1 -0
- data/spec/opal/core/language/keyword_arguments_spec.rb +11 -0
- data/spec/opal/core/language/send_spec.rb +5 -0
- data/spec/opal/core/method/to_proc_spec.rb +28 -0
- data/spec/opal/core/module/name_spec.rb +0 -17
- data/spec/opal/core/runtime/bridged_classes_spec.rb +2 -2
- data/spec/opal/core/runtime/eval_spec.rb +1 -1
- data/spec/opal/core/runtime/method_missing_spec.rb +6 -0
- data/spec/opal/core/runtime_spec.rb +51 -0
- data/spec/opal/stdlib/js_spec.rb +66 -0
- data/spec/opal/stdlib/native/hash_spec.rb +36 -0
- data/spec/rubyspecs +152 -273
- data/spec/spec_helper.rb +10 -11
- data/stdlib/base64.rb +9 -9
- data/stdlib/benchmark.rb +551 -4
- data/stdlib/console.rb +94 -0
- data/stdlib/date.rb +1 -1
- data/stdlib/encoding.rb +1 -170
- data/stdlib/js.rb +56 -0
- data/stdlib/json.rb +9 -14
- data/stdlib/math.rb +1 -370
- data/stdlib/native.rb +133 -63
- data/stdlib/nodejs/file.rb +5 -0
- data/stdlib/nodejs/fileutils.rb +13 -6
- data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/README.md +1 -1
- data/stdlib/opal-parser.rb +1 -2
- data/stdlib/ostruct.rb +65 -6
- data/stdlib/pp.rb +2 -4
- data/stdlib/rbconfig.rb +1 -3
- data/stdlib/strscan.rb +164 -28
- data/tasks/benchmarking.rake +88 -0
- data/tasks/testing.rake +181 -55
- data/{lib/mspec/opal/special_calls.rb → tasks/testing/mspec_special_calls.rb} +1 -1
- data/{lib/mspec/opal/sprockets.js → tasks/testing/phantomjs1-sprockets.js} +17 -6
- data/test/opal/test_keyword.rb +590 -0
- data/vendored-minitest/minitest.rb +2 -2
- data/vendored-minitest/test/unit.rb +5 -0
- metadata +229 -62
- data/benchmarks/operators.rb +0 -11
- data/benchmarks/prova.js.rb +0 -13
- data/docs/libraries.md +0 -36
- data/lib/mspec/opal/new.html.erb +0 -1
- data/lib/mspec/opal/rake_task.rb +0 -248
- data/opal/corelib/match_data.rb +0 -128
- data/spec/filters/bugs/math.rb +0 -95
- data/spec/filters/bugs/nil.rb +0 -7
- data/spec/filters/bugs/opal.rb +0 -9
- data/spec/filters/bugs/regular_expressions.rb +0 -41
- data/spec/filters/bugs/stringscanner.rb +0 -33
- data/spec/filters/unsupported/encoding.rb +0 -102
- data/spec/filters/unsupported/frozen.rb +0 -92
- data/spec/filters/unsupported/hash_compare_by_identity.rb +0 -16
- data/spec/filters/unsupported/integer_size.rb +0 -59
- data/spec/filters/unsupported/method_added.rb +0 -10
- data/spec/filters/unsupported/private_constants.rb +0 -30
- data/spec/filters/unsupported/private_methods.rb +0 -55
- data/spec/filters/unsupported/random.rb +0 -4
- data/spec/filters/unsupported/rational_numbers.rb +0 -4
- data/spec/filters/unsupported/regular_expressions.rb +0 -137
- data/spec/filters/unsupported/ruby_exe.rb +0 -5
- data/spec/filters/unsupported/symbols.rb +0 -17
- data/spec/filters/unsupported/tainted.rb +0 -180
- data/spec/filters/unsupported/trusted.rb +0 -88
- data/stdlib/process.rb +0 -10
- data/tasks/documenting.rake +0 -37
@@ -0,0 +1,5 @@
|
|
1
|
+
a = ['4768', '4964', '4266', '4872', '4231', '4017', '4565', '4793', '4298', '4135', '4639', '4780', '4237', '4548', '4655', '4153', '4654', '4922', '4563', '4042', '4329', '4699', '4352', '4127', '4544', '4906', '4814', '4948', '4977', '4830', '4405', '4642', '4666', '4402', '4679', '4465', '4401', '4155', '4767', '4510', '4747', '4993', '4508', '4697', '4758', '4133', '4348', '4200', '4442', '4970', '4452', '4041', '4103', '4567', '4937', '4047', '4933', '4121', '4860', '4659', '4221', '4312', '4583', '4473', '4973', '4262', '4630', '4123', '4139', '4289', '4147', '4222', '4050', '4019', '4454', '4253', '4552', '4947', '4725', '4457', '4929', '4021', '4502', '4307', '4576', '4124', '4586', '4610', '4027', '4572', '4926', '4753', '4185', '4382', '4394', '4923', '4186', '4254', '4012', '4417', '4556', '4349', '4550', '4330', '4938', '4985', '4778', '4716', '4924', '4045', '4358', '4189', '4591', '4213', '4851', '4825', '4260', '4198', '4342', '4824', '4333', '4244', '4752', '4994', '4488', '4532', '4082', '4595', '4098', '4436', '4540', '4267', '4407', '4998', '4751', '4535', '4861', '4819', '4419', '4031', '4029', '4453', '4698', '4965', '4450', '4668', '4036', '4300', '4519', '4281', '4981', '4818', '4939', '4378', '4140', '4841', '4249', '4290', '4388', '4878', '4884', '4235', '4515', '4638', '4410', '4054', '4383', '4238', '4870', '4295', '4804', '4308', '4614', '4105', '4053', '4446', '4757', '4971', '4637', '4831', '4193', '4912', '4000', '4187', '4606', '4566', '4169', '4641', '4749', '4729', '4928', '4601', '4949', '4210', '4313', '4647', '4495', '4460', '4621', '4605', '4694', '4317', '4226', '4263', '4016', '4997', '4940', '4715', '4907', '4620', '4934', '4996', '4955', '4688', '4304', '4220', '4882', '4772', '4536', '4815', '4693', '4469', '4276', '4409', '4071', '4224', '4020', '4629', '4865', '4813', '4366', '4622', '4129', '4533', '4634', '4564', '4087', '4386', '4161', '4265', '4711', '4009', '4376', '4781', '4837', '4112', '4915', '4592', '4658', '4025', '4987', '4291', '4477', '4503', '4437', '4111', '4707', '4879', '4611', '4549', '4078', '4044', '4853', '4835', '4463', '4577', '4008', '4233', '4741', '4384', '4225', '4024', '4726', '4743', '4160', '4180', '4722', '4609', '4114', '4834', '4742', '4662', '4984', '4299', '4060', '4498', '4755', '4320', '4874', '4528', '4216', '4852', '4951', '4958', '4283', '4239', '4476', '4644', '4143', '4104', '4455', '4126', '4950', '4663', '4013', '4931', '4850', '4242', '4130', '4623', '4871', '4014', '4854', '4293', '4512', '4166', '4740', '4735', '4150', '4651', '4172', '4836', '4530', '4664', '4429', '4511', '4558', '4676', '4085', '4074', '4580', '4794', '4379', '4310', '4817', '4966', '4848', '4202', '4336', '4608', '4351', '4396', '4652', '4033', '4188', '4431', '4916', '4259', '4607', '4816', '4810', '4627', '4527', '4560', '4728', '4589', '4274', '4809', '4790', '4398', '4414', '4516', '4581', '4919', '4665', '4331', '4978', '4543', '4877', '4974', '4284', '4004', '4177', '4466', '4116', '4217', '4901', '4372', '4137', '4806', '4264', '4497', '4294', '4787', '4212', '4215', '4115', '4782', '4739', '4821', '4125', '4505', '4230', '4399', '4395', '4079', '4867', '4381', '4706', '4695', '4404', '4691', '4075', '4353', '4301', '4876', '4731', '4523', '4246', '4529', '4412', '4784', '4449', '4229', '4616', '4158', '4002', '4318', '4377', '4205', '4911', '4777', '4792', '4271', '4763', '4141', '4287', '4890', '4279', '4829', '4646', '4840', '4089', '4880', '4067', '4918', '4059', '4109', '4164', '4863', '4883', '4909', '4361', '4174', '4960', '4302', '4003', '4236', '4846', '4034', '4324', '4513', '4765', '4596', '4900', '4007', '4603', '4474', '4439', '4805', '4015', '4496', '4953', '4363', '4551', '4459', '4063', '4983', '4881', '4365', '4604', '4587', '4798', '4005', '4163', '4421', '4471', '4826', '4144', '4635', '4600', '4913', '4640', '4247', '4766', '4779', '4280', '4391', '4891', '4636', '4546', '4683', '4181', '4081', '4862', '4458', '4037', '4321', '4786', '4717', '4628', '4154', '4326', '4032', '4873', '4151', '4905', '4270', '4156', '4733', '4980', '4866', '4325', '4055', '4467', '4480', '4286', '4191', '4762', '4322', '4574', '4022', '4056', '4770', '4451', '4448', '4845', '4341', '4433', '4245', '4684', '4671', '4093', '4920', '4272', '4745', '4799', '4761', '4250', '4578', '4347', '4499', '4526', '4369', '4162', '4537', '4434', '4893', '4120', '4962', '4667', '4525', '4091', '4462', '4182', '4738', '4935', '4173', '4490', '4571', '4424', '4894', '4051', '4214', '4823', '4096', '4206', '4598', '4943', '4701', '4649', '4807', '4107', '4435', '4456', '4083', '4612', '4721', '4472', '4146', '4925', '4340', '4789', '4277', '4375', '4211', '4427', '4547', '4690', '4613', '4727', '4006', '4203', '4430', '4223', '4039', '4932', '4296', '4108', '4278', '4832', '4422', '4917', '4470', '4183', '4887', '4076', '4485', '4597', '4443', '4257', '4991', '4944', '4196', '4672', '4397', '4097', '4119', '4077', '4773', '4602', '4538', '4479', '4968', '4159', '4539', '4956', '4710', '4812', '4902', '4569', '4954', '4385', '4128', '4936', '4416', '4148', '4632', '4759', '4117', '4896', '4392', '4864', '4316', '4132', '4319', '4969', '4175', '4484', '4903', '4910', '4350', '4332', '4952', '4176', '4594', '4709', '4509', '4178', '4167', '4545', '4857', '4617', '4501', '4859', '4207', '4275', '4687', '4049', '4579', '4046', '4921', '4113', '4898', '4681', '4052', '4415', '4064', '4184', '4895', '4744', '4685', '4084', '4305', '4899', '4559', '4208', '4057', '4507', '4258', '4355', '4086', '4373', '4323', '4541', '4297', '4483', '4889', '4531', '4327', '4441', '4914', '4303', '4677', '4445', '4802', '4343', '4585', '4338', '4524', '4590', '4624', '4288', '4704', '4134', '4043', '4720', '4058', '4328', '4095', '4026', '4423', '4657', '4118', '4633', '4487', '4822', '4904', '4255', '4001', '4387', '4500', '4190', '4686', '4995', '4661', '4783', '4992', '4165', '4065', '4927', '4306', '4856', '4292', '4420', '4963', '4468', '4240', '4724', '4432', '4447', '4518', '4028', '4670', '4339', '4771', '4018', '4489', '4110', '4708', '4945', '4136', '4492', '4930', '4090', '4734', '4886', '4542', '4227', '4486', '4491', '4713', '4986', '4068', '4048', '4975', '4570', '4842', '4475', '4131', '4555', '4428', '4776', '4101', '4273', '4811', '4345', '5000', '4653', '4256', '4209', '4769', '4946', '4561', '4080', '4461', '4820', '4311', '4959', '4750', '4795', '4748', '4368', '4506', '4335', '4346', '4568', '4675', '4692', '4774', '4413', '4370', '4723', '4521', '4885', '4678', '4897', '4066', '4674', '4106', '4626', '4389', '4204', '4839', '4023', '4712', '4145', '4035', '4357', '4756', '4648', '4972', '4157', '4406', '4615', '4061', '4219', '4791', '4660', '4073', '4356', '4072', '4599', '4359', '4094', '4673', '4696', '4796', '4282', '4714', '4522', '4736', '4775', '4760', '4400', '4847', '4228', '4803', '4908', '4732', '4645', '4122', '4218', '4478', '4941', '4892', '4364', '4403', '4152', '4444', '4360', '4354', '4241', '4494', '4367', '4808', '4261', '4088', '4573', '4554', '4248', '4371', '4393', '4268', '4201', '4038', '4788', '4593', '4040', '4801', '4582', '4309', '4976', '4374', '4869', '4380', '4514', '4243', '4362', '4849', '4680', '4888', '4764', '4618', '4838', '4828', '4643', '4010', '4827', '4957', '4099', '4875', '4843', '4737', '4102', '4979', '4011', '4504', '4440', '4746', '4557', '4426', '4553', '4656', '4868', '4689', '4988', '4703', '4967', '4069', '4619', '4334', '4669', '4785', '4464', '4562', '4961', '4625', '4754', '4797', '4481', '4705', '4199', '4337', '4062', '4138', '4702', '4534', '4168', '4418', '4092', '4682', '4520', '4030', '4171', '4650', '4858', '4411', '4999', '4252', '4197', '4170', '4942', '4631', '4990', '4179', '4285', '4700', '4482', '4575', '4800', '4070', '4251', '4344', '4982', '4719', '4390', '4149', '4100', '4194', '4269', '4855', '4314', '4718', '4232', '4730', '4438', '4588', '4195', '4192', '4493', '4517', '4833', '4234', '4989', '4315', '4844', '4142', '4408', '4584', '4425']
|
2
|
+
|
3
|
+
1000.times do
|
4
|
+
a.uniq!
|
5
|
+
end
|
@@ -0,0 +1,5 @@
|
|
1
|
+
a = [4768, 4964, 4266, 4872, 4231, 4017, 4565, 4793, 4298, 4135, 4639, 4780, 4237, 4548, 4655, 4153, 4654, 4922, 4563, 4042, 4329, 4699, 4352, 4127, 4544, 4906, 4814, 4948, 4977, 4830, 4405, 4642, 4666, 4402, 4679, 4465, 4401, 4155, 4767, 4510, 4747, 4993, 4508, 4697, 4758, 4133, 4348, 4200, 4442, 4970, 4452, 4041, 4103, 4567, 4937, 4047, 4933, 4121, 4860, 4659, 4221, 4312, 4583, 4473, 4973, 4262, 4630, 4123, 4139, 4289, 4147, 4222, 4050, 4019, 4454, 4253, 4552, 4947, 4725, 4457, 4929, 4021, 4502, 4307, 4576, 4124, 4586, 4610, 4027, 4572, 4926, 4753, 4185, 4382, 4394, 4923, 4186, 4254, 4012, 4417, 4556, 4349, 4550, 4330, 4938, 4985, 4778, 4716, 4924, 4045, 4358, 4189, 4591, 4213, 4851, 4825, 4260, 4198, 4342, 4824, 4333, 4244, 4752, 4994, 4488, 4532, 4082, 4595, 4098, 4436, 4540, 4267, 4407, 4998, 4751, 4535, 4861, 4819, 4419, 4031, 4029, 4453, 4698, 4965, 4450, 4668, 4036, 4300, 4519, 4281, 4981, 4818, 4939, 4378, 4140, 4841, 4249, 4290, 4388, 4878, 4884, 4235, 4515, 4638, 4410, 4054, 4383, 4238, 4870, 4295, 4804, 4308, 4614, 4105, 4053, 4446, 4757, 4971, 4637, 4831, 4193, 4912, 4000, 4187, 4606, 4566, 4169, 4641, 4749, 4729, 4928, 4601, 4949, 4210, 4313, 4647, 4495, 4460, 4621, 4605, 4694, 4317, 4226, 4263, 4016, 4997, 4940, 4715, 4907, 4620, 4934, 4996, 4955, 4688, 4304, 4220, 4882, 4772, 4536, 4815, 4693, 4469, 4276, 4409, 4071, 4224, 4020, 4629, 4865, 4813, 4366, 4622, 4129, 4533, 4634, 4564, 4087, 4386, 4161, 4265, 4711, 4009, 4376, 4781, 4837, 4112, 4915, 4592, 4658, 4025, 4987, 4291, 4477, 4503, 4437, 4111, 4707, 4879, 4611, 4549, 4078, 4044, 4853, 4835, 4463, 4577, 4008, 4233, 4741, 4384, 4225, 4024, 4726, 4743, 4160, 4180, 4722, 4609, 4114, 4834, 4742, 4662, 4984, 4299, 4060, 4498, 4755, 4320, 4874, 4528, 4216, 4852, 4951, 4958, 4283, 4239, 4476, 4644, 4143, 4104, 4455, 4126, 4950, 4663, 4013, 4931, 4850, 4242, 4130, 4623, 4871, 4014, 4854, 4293, 4512, 4166, 4740, 4735, 4150, 4651, 4172, 4836, 4530, 4664, 4429, 4511, 4558, 4676, 4085, 4074, 4580, 4794, 4379, 4310, 4817, 4966, 4848, 4202, 4336, 4608, 4351, 4396, 4652, 4033, 4188, 4431, 4916, 4259, 4607, 4816, 4810, 4627, 4527, 4560, 4728, 4589, 4274, 4809, 4790, 4398, 4414, 4516, 4581, 4919, 4665, 4331, 4978, 4543, 4877, 4974, 4284, 4004, 4177, 4466, 4116, 4217, 4901, 4372, 4137, 4806, 4264, 4497, 4294, 4787, 4212, 4215, 4115, 4782, 4739, 4821, 4125, 4505, 4230, 4399, 4395, 4079, 4867, 4381, 4706, 4695, 4404, 4691, 4075, 4353, 4301, 4876, 4731, 4523, 4246, 4529, 4412, 4784, 4449, 4229, 4616, 4158, 4002, 4318, 4377, 4205, 4911, 4777, 4792, 4271, 4763, 4141, 4287, 4890, 4279, 4829, 4646, 4840, 4089, 4880, 4067, 4918, 4059, 4109, 4164, 4863, 4883, 4909, 4361, 4174, 4960, 4302, 4003, 4236, 4846, 4034, 4324, 4513, 4765, 4596, 4900, 4007, 4603, 4474, 4439, 4805, 4015, 4496, 4953, 4363, 4551, 4459, 4063, 4983, 4881, 4365, 4604, 4587, 4798, 4005, 4163, 4421, 4471, 4826, 4144, 4635, 4600, 4913, 4640, 4247, 4766, 4779, 4280, 4391, 4891, 4636, 4546, 4683, 4181, 4081, 4862, 4458, 4037, 4321, 4786, 4717, 4628, 4154, 4326, 4032, 4873, 4151, 4905, 4270, 4156, 4733, 4980, 4866, 4325, 4055, 4467, 4480, 4286, 4191, 4762, 4322, 4574, 4022, 4056, 4770, 4451, 4448, 4845, 4341, 4433, 4245, 4684, 4671, 4093, 4920, 4272, 4745, 4799, 4761, 4250, 4578, 4347, 4499, 4526, 4369, 4162, 4537, 4434, 4893, 4120, 4962, 4667, 4525, 4091, 4462, 4182, 4738, 4935, 4173, 4490, 4571, 4424, 4894, 4051, 4214, 4823, 4096, 4206, 4598, 4943, 4701, 4649, 4807, 4107, 4435, 4456, 4083, 4612, 4721, 4472, 4146, 4925, 4340, 4789, 4277, 4375, 4211, 4427, 4547, 4690, 4613, 4727, 4006, 4203, 4430, 4223, 4039, 4932, 4296, 4108, 4278, 4832, 4422, 4917, 4470, 4183, 4887, 4076, 4485, 4597, 4443, 4257, 4991, 4944, 4196, 4672, 4397, 4097, 4119, 4077, 4773, 4602, 4538, 4479, 4968, 4159, 4539, 4956, 4710, 4812, 4902, 4569, 4954, 4385, 4128, 4936, 4416, 4148, 4632, 4759, 4117, 4896, 4392, 4864, 4316, 4132, 4319, 4969, 4175, 4484, 4903, 4910, 4350, 4332, 4952, 4176, 4594, 4709, 4509, 4178, 4167, 4545, 4857, 4617, 4501, 4859, 4207, 4275, 4687, 4049, 4579, 4046, 4921, 4113, 4898, 4681, 4052, 4415, 4064, 4184, 4895, 4744, 4685, 4084, 4305, 4899, 4559, 4208, 4057, 4507, 4258, 4355, 4086, 4373, 4323, 4541, 4297, 4483, 4889, 4531, 4327, 4441, 4914, 4303, 4677, 4445, 4802, 4343, 4585, 4338, 4524, 4590, 4624, 4288, 4704, 4134, 4043, 4720, 4058, 4328, 4095, 4026, 4423, 4657, 4118, 4633, 4487, 4822, 4904, 4255, 4001, 4387, 4500, 4190, 4686, 4995, 4661, 4783, 4992, 4165, 4065, 4927, 4306, 4856, 4292, 4420, 4963, 4468, 4240, 4724, 4432, 4447, 4518, 4028, 4670, 4339, 4771, 4018, 4489, 4110, 4708, 4945, 4136, 4492, 4930, 4090, 4734, 4886, 4542, 4227, 4486, 4491, 4713, 4986, 4068, 4048, 4975, 4570, 4842, 4475, 4131, 4555, 4428, 4776, 4101, 4273, 4811, 4345, 5000, 4653, 4256, 4209, 4769, 4946, 4561, 4080, 4461, 4820, 4311, 4959, 4750, 4795, 4748, 4368, 4506, 4335, 4346, 4568, 4675, 4692, 4774, 4413, 4370, 4723, 4521, 4885, 4678, 4897, 4066, 4674, 4106, 4626, 4389, 4204, 4839, 4023, 4712, 4145, 4035, 4357, 4756, 4648, 4972, 4157, 4406, 4615, 4061, 4219, 4791, 4660, 4073, 4356, 4072, 4599, 4359, 4094, 4673, 4696, 4796, 4282, 4714, 4522, 4736, 4775, 4760, 4400, 4847, 4228, 4803, 4908, 4732, 4645, 4122, 4218, 4478, 4941, 4892, 4364, 4403, 4152, 4444, 4360, 4354, 4241, 4494, 4367, 4808, 4261, 4088, 4573, 4554, 4248, 4371, 4393, 4268, 4201, 4038, 4788, 4593, 4040, 4801, 4582, 4309, 4976, 4374, 4869, 4380, 4514, 4243, 4362, 4849, 4680, 4888, 4764, 4618, 4838, 4828, 4643, 4010, 4827, 4957, 4099, 4875, 4843, 4737, 4102, 4979, 4011, 4504, 4440, 4746, 4557, 4426, 4553, 4656, 4868, 4689, 4988, 4703, 4967, 4069, 4619, 4334, 4669, 4785, 4464, 4562, 4961, 4625, 4754, 4797, 4481, 4705, 4199, 4337, 4062, 4138, 4702, 4534, 4168, 4418, 4092, 4682, 4520, 4030, 4171, 4650, 4858, 4411, 4999, 4252, 4197, 4170, 4942, 4631, 4990, 4179, 4285, 4700, 4482, 4575, 4800, 4070, 4251, 4344, 4982, 4719, 4390, 4149, 4100, 4194, 4269, 4855, 4314, 4718, 4232, 4730, 4438, 4588, 4195, 4192, 4493, 4517, 4833, 4234, 4989, 4315, 4844, 4142, 4408, 4584, 4425]
|
2
|
+
|
3
|
+
1000.times do
|
4
|
+
x = a.uniq
|
5
|
+
end
|
@@ -0,0 +1,5 @@
|
|
1
|
+
a = [Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new, Object.new]
|
2
|
+
|
3
|
+
1000.times do
|
4
|
+
x = a.uniq
|
5
|
+
end
|
@@ -0,0 +1,5 @@
|
|
1
|
+
a = ['4768', '4964', '4266', '4872', '4231', '4017', '4565', '4793', '4298', '4135', '4639', '4780', '4237', '4548', '4655', '4153', '4654', '4922', '4563', '4042', '4329', '4699', '4352', '4127', '4544', '4906', '4814', '4948', '4977', '4830', '4405', '4642', '4666', '4402', '4679', '4465', '4401', '4155', '4767', '4510', '4747', '4993', '4508', '4697', '4758', '4133', '4348', '4200', '4442', '4970', '4452', '4041', '4103', '4567', '4937', '4047', '4933', '4121', '4860', '4659', '4221', '4312', '4583', '4473', '4973', '4262', '4630', '4123', '4139', '4289', '4147', '4222', '4050', '4019', '4454', '4253', '4552', '4947', '4725', '4457', '4929', '4021', '4502', '4307', '4576', '4124', '4586', '4610', '4027', '4572', '4926', '4753', '4185', '4382', '4394', '4923', '4186', '4254', '4012', '4417', '4556', '4349', '4550', '4330', '4938', '4985', '4778', '4716', '4924', '4045', '4358', '4189', '4591', '4213', '4851', '4825', '4260', '4198', '4342', '4824', '4333', '4244', '4752', '4994', '4488', '4532', '4082', '4595', '4098', '4436', '4540', '4267', '4407', '4998', '4751', '4535', '4861', '4819', '4419', '4031', '4029', '4453', '4698', '4965', '4450', '4668', '4036', '4300', '4519', '4281', '4981', '4818', '4939', '4378', '4140', '4841', '4249', '4290', '4388', '4878', '4884', '4235', '4515', '4638', '4410', '4054', '4383', '4238', '4870', '4295', '4804', '4308', '4614', '4105', '4053', '4446', '4757', '4971', '4637', '4831', '4193', '4912', '4000', '4187', '4606', '4566', '4169', '4641', '4749', '4729', '4928', '4601', '4949', '4210', '4313', '4647', '4495', '4460', '4621', '4605', '4694', '4317', '4226', '4263', '4016', '4997', '4940', '4715', '4907', '4620', '4934', '4996', '4955', '4688', '4304', '4220', '4882', '4772', '4536', '4815', '4693', '4469', '4276', '4409', '4071', '4224', '4020', '4629', '4865', '4813', '4366', '4622', '4129', '4533', '4634', '4564', '4087', '4386', '4161', '4265', '4711', '4009', '4376', '4781', '4837', '4112', '4915', '4592', '4658', '4025', '4987', '4291', '4477', '4503', '4437', '4111', '4707', '4879', '4611', '4549', '4078', '4044', '4853', '4835', '4463', '4577', '4008', '4233', '4741', '4384', '4225', '4024', '4726', '4743', '4160', '4180', '4722', '4609', '4114', '4834', '4742', '4662', '4984', '4299', '4060', '4498', '4755', '4320', '4874', '4528', '4216', '4852', '4951', '4958', '4283', '4239', '4476', '4644', '4143', '4104', '4455', '4126', '4950', '4663', '4013', '4931', '4850', '4242', '4130', '4623', '4871', '4014', '4854', '4293', '4512', '4166', '4740', '4735', '4150', '4651', '4172', '4836', '4530', '4664', '4429', '4511', '4558', '4676', '4085', '4074', '4580', '4794', '4379', '4310', '4817', '4966', '4848', '4202', '4336', '4608', '4351', '4396', '4652', '4033', '4188', '4431', '4916', '4259', '4607', '4816', '4810', '4627', '4527', '4560', '4728', '4589', '4274', '4809', '4790', '4398', '4414', '4516', '4581', '4919', '4665', '4331', '4978', '4543', '4877', '4974', '4284', '4004', '4177', '4466', '4116', '4217', '4901', '4372', '4137', '4806', '4264', '4497', '4294', '4787', '4212', '4215', '4115', '4782', '4739', '4821', '4125', '4505', '4230', '4399', '4395', '4079', '4867', '4381', '4706', '4695', '4404', '4691', '4075', '4353', '4301', '4876', '4731', '4523', '4246', '4529', '4412', '4784', '4449', '4229', '4616', '4158', '4002', '4318', '4377', '4205', '4911', '4777', '4792', '4271', '4763', '4141', '4287', '4890', '4279', '4829', '4646', '4840', '4089', '4880', '4067', '4918', '4059', '4109', '4164', '4863', '4883', '4909', '4361', '4174', '4960', '4302', '4003', '4236', '4846', '4034', '4324', '4513', '4765', '4596', '4900', '4007', '4603', '4474', '4439', '4805', '4015', '4496', '4953', '4363', '4551', '4459', '4063', '4983', '4881', '4365', '4604', '4587', '4798', '4005', '4163', '4421', '4471', '4826', '4144', '4635', '4600', '4913', '4640', '4247', '4766', '4779', '4280', '4391', '4891', '4636', '4546', '4683', '4181', '4081', '4862', '4458', '4037', '4321', '4786', '4717', '4628', '4154', '4326', '4032', '4873', '4151', '4905', '4270', '4156', '4733', '4980', '4866', '4325', '4055', '4467', '4480', '4286', '4191', '4762', '4322', '4574', '4022', '4056', '4770', '4451', '4448', '4845', '4341', '4433', '4245', '4684', '4671', '4093', '4920', '4272', '4745', '4799', '4761', '4250', '4578', '4347', '4499', '4526', '4369', '4162', '4537', '4434', '4893', '4120', '4962', '4667', '4525', '4091', '4462', '4182', '4738', '4935', '4173', '4490', '4571', '4424', '4894', '4051', '4214', '4823', '4096', '4206', '4598', '4943', '4701', '4649', '4807', '4107', '4435', '4456', '4083', '4612', '4721', '4472', '4146', '4925', '4340', '4789', '4277', '4375', '4211', '4427', '4547', '4690', '4613', '4727', '4006', '4203', '4430', '4223', '4039', '4932', '4296', '4108', '4278', '4832', '4422', '4917', '4470', '4183', '4887', '4076', '4485', '4597', '4443', '4257', '4991', '4944', '4196', '4672', '4397', '4097', '4119', '4077', '4773', '4602', '4538', '4479', '4968', '4159', '4539', '4956', '4710', '4812', '4902', '4569', '4954', '4385', '4128', '4936', '4416', '4148', '4632', '4759', '4117', '4896', '4392', '4864', '4316', '4132', '4319', '4969', '4175', '4484', '4903', '4910', '4350', '4332', '4952', '4176', '4594', '4709', '4509', '4178', '4167', '4545', '4857', '4617', '4501', '4859', '4207', '4275', '4687', '4049', '4579', '4046', '4921', '4113', '4898', '4681', '4052', '4415', '4064', '4184', '4895', '4744', '4685', '4084', '4305', '4899', '4559', '4208', '4057', '4507', '4258', '4355', '4086', '4373', '4323', '4541', '4297', '4483', '4889', '4531', '4327', '4441', '4914', '4303', '4677', '4445', '4802', '4343', '4585', '4338', '4524', '4590', '4624', '4288', '4704', '4134', '4043', '4720', '4058', '4328', '4095', '4026', '4423', '4657', '4118', '4633', '4487', '4822', '4904', '4255', '4001', '4387', '4500', '4190', '4686', '4995', '4661', '4783', '4992', '4165', '4065', '4927', '4306', '4856', '4292', '4420', '4963', '4468', '4240', '4724', '4432', '4447', '4518', '4028', '4670', '4339', '4771', '4018', '4489', '4110', '4708', '4945', '4136', '4492', '4930', '4090', '4734', '4886', '4542', '4227', '4486', '4491', '4713', '4986', '4068', '4048', '4975', '4570', '4842', '4475', '4131', '4555', '4428', '4776', '4101', '4273', '4811', '4345', '5000', '4653', '4256', '4209', '4769', '4946', '4561', '4080', '4461', '4820', '4311', '4959', '4750', '4795', '4748', '4368', '4506', '4335', '4346', '4568', '4675', '4692', '4774', '4413', '4370', '4723', '4521', '4885', '4678', '4897', '4066', '4674', '4106', '4626', '4389', '4204', '4839', '4023', '4712', '4145', '4035', '4357', '4756', '4648', '4972', '4157', '4406', '4615', '4061', '4219', '4791', '4660', '4073', '4356', '4072', '4599', '4359', '4094', '4673', '4696', '4796', '4282', '4714', '4522', '4736', '4775', '4760', '4400', '4847', '4228', '4803', '4908', '4732', '4645', '4122', '4218', '4478', '4941', '4892', '4364', '4403', '4152', '4444', '4360', '4354', '4241', '4494', '4367', '4808', '4261', '4088', '4573', '4554', '4248', '4371', '4393', '4268', '4201', '4038', '4788', '4593', '4040', '4801', '4582', '4309', '4976', '4374', '4869', '4380', '4514', '4243', '4362', '4849', '4680', '4888', '4764', '4618', '4838', '4828', '4643', '4010', '4827', '4957', '4099', '4875', '4843', '4737', '4102', '4979', '4011', '4504', '4440', '4746', '4557', '4426', '4553', '4656', '4868', '4689', '4988', '4703', '4967', '4069', '4619', '4334', '4669', '4785', '4464', '4562', '4961', '4625', '4754', '4797', '4481', '4705', '4199', '4337', '4062', '4138', '4702', '4534', '4168', '4418', '4092', '4682', '4520', '4030', '4171', '4650', '4858', '4411', '4999', '4252', '4197', '4170', '4942', '4631', '4990', '4179', '4285', '4700', '4482', '4575', '4800', '4070', '4251', '4344', '4982', '4719', '4390', '4149', '4100', '4194', '4269', '4855', '4314', '4718', '4232', '4730', '4438', '4588', '4195', '4192', '4493', '4517', '4833', '4234', '4989', '4315', '4844', '4142', '4408', '4584', '4425']
|
2
|
+
|
3
|
+
1000.times do
|
4
|
+
x = a.uniq
|
5
|
+
end
|
@@ -0,0 +1,57 @@
|
|
1
|
+
class BindTableDispatch
|
2
|
+
attr_reader :event_log
|
3
|
+
|
4
|
+
def initialize
|
5
|
+
@event_log = []
|
6
|
+
end
|
7
|
+
|
8
|
+
def self.method_added_cheat(method_name)
|
9
|
+
if method_name.to_s =~ /^handle_(.+)$/
|
10
|
+
handler_methods[$1.to_sym] = instance_method(method_name)
|
11
|
+
end
|
12
|
+
# Cheating here, because Opal does not support method_added hook yet
|
13
|
+
# Uncomment the super below when it does:
|
14
|
+
# super
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.handler_methods
|
18
|
+
@handler_methods ||= {}
|
19
|
+
end
|
20
|
+
|
21
|
+
def call(event)
|
22
|
+
if (handler_method = self.class.handler_methods[event.name])
|
23
|
+
handler_method.bind(self).call(event)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
def handle_foo(event)
|
28
|
+
event_log << event
|
29
|
+
end
|
30
|
+
|
31
|
+
def handle_bar(event)
|
32
|
+
event_log << event
|
33
|
+
end
|
34
|
+
|
35
|
+
def handle_baz(event)
|
36
|
+
event_log << event
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
klass = BindTableDispatch
|
41
|
+
event = Struct.new(:name, :source, :args)
|
42
|
+
|
43
|
+
# Cheating here, because Opal does not support method_added hook yet
|
44
|
+
klass.method_added_cheat(:handle_foo)
|
45
|
+
klass.method_added_cheat(:handle_bar)
|
46
|
+
klass.method_added_cheat(:handle_baz)
|
47
|
+
|
48
|
+
100_000.times do
|
49
|
+
obj = klass.new
|
50
|
+
obj.call(e1 = event[:foo])
|
51
|
+
obj.call(e2 = event[:bar])
|
52
|
+
obj.call(e3 = event[:baz])
|
53
|
+
obj.call(event[:buz])
|
54
|
+
unless obj.event_log == [e1, e2, e3]
|
55
|
+
raise "#{klass}: #{obj.event_log.inspect}"
|
56
|
+
end
|
57
|
+
end
|
@@ -0,0 +1,65 @@
|
|
1
|
+
class CodeGenDispatch
|
2
|
+
attr_reader :event_log
|
3
|
+
|
4
|
+
def initialize
|
5
|
+
@event_log = []
|
6
|
+
end
|
7
|
+
|
8
|
+
def self.method_added_cheat(method_name)
|
9
|
+
if method_name.to_s =~ /^handle_(.+)$/
|
10
|
+
handler_methods << $1
|
11
|
+
regenerate_dispatch_method
|
12
|
+
end
|
13
|
+
# Cheating here, because Opal does not support method_added hook yet
|
14
|
+
# Uncomment the super below when it does:
|
15
|
+
# super
|
16
|
+
end
|
17
|
+
|
18
|
+
def self.handler_methods
|
19
|
+
@handler_methods ||= []
|
20
|
+
end
|
21
|
+
|
22
|
+
def self.regenerate_dispatch_method
|
23
|
+
dispatch_table = handler_methods.map { |event_name|
|
24
|
+
"when :#{event_name} then handle_#{event_name}(event)"
|
25
|
+
}.join("\n")
|
26
|
+
class_eval %{
|
27
|
+
def call(event)
|
28
|
+
case event.name
|
29
|
+
#{dispatch_table}
|
30
|
+
end
|
31
|
+
end
|
32
|
+
}
|
33
|
+
end
|
34
|
+
|
35
|
+
def handle_foo(event)
|
36
|
+
event_log << event
|
37
|
+
end
|
38
|
+
|
39
|
+
def handle_bar(event)
|
40
|
+
event_log << event
|
41
|
+
end
|
42
|
+
|
43
|
+
def handle_baz(event)
|
44
|
+
event_log << event
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
klass = CodeGenDispatch
|
49
|
+
event = Struct.new(:name, :source, :args)
|
50
|
+
|
51
|
+
# Cheating here, because Opal does not support method_added hook yet
|
52
|
+
klass.method_added_cheat(:handle_foo)
|
53
|
+
klass.method_added_cheat(:handle_bar)
|
54
|
+
klass.method_added_cheat(:handle_baz)
|
55
|
+
|
56
|
+
100_000.times do
|
57
|
+
obj = klass.new
|
58
|
+
obj.call(e1 = event[:foo])
|
59
|
+
obj.call(e2 = event[:bar])
|
60
|
+
obj.call(e3 = event[:baz])
|
61
|
+
obj.call(event[:buz])
|
62
|
+
unless obj.event_log == [e1, e2, e3]
|
63
|
+
raise "#{klass}: #{obj.event_log.inspect}"
|
64
|
+
end
|
65
|
+
end
|
@@ -0,0 +1,64 @@
|
|
1
|
+
class IfCodeGenDispatch
|
2
|
+
attr_reader :event_log
|
3
|
+
|
4
|
+
def initialize
|
5
|
+
@event_log = []
|
6
|
+
end
|
7
|
+
|
8
|
+
def self.method_added_cheat(method_name)
|
9
|
+
if method_name.to_s =~ /^handle_(.+)$/
|
10
|
+
handler_methods << $1
|
11
|
+
regenerate_dispatch_method
|
12
|
+
end
|
13
|
+
# Cheating here, because Opal does not support method_added hook yet
|
14
|
+
# Uncomment the super below when it does:
|
15
|
+
# super
|
16
|
+
end
|
17
|
+
|
18
|
+
def self.handler_methods
|
19
|
+
@handler_methods ||= []
|
20
|
+
end
|
21
|
+
|
22
|
+
def self.regenerate_dispatch_method
|
23
|
+
dispatch_table = handler_methods.map { |event_name|
|
24
|
+
"event.name.equal?(:#{event_name}) then handle_#{event_name}(event)"
|
25
|
+
}.join("\nelsif ")
|
26
|
+
class_eval %{
|
27
|
+
def call(event)
|
28
|
+
if #{dispatch_table}
|
29
|
+
end
|
30
|
+
end
|
31
|
+
}
|
32
|
+
end
|
33
|
+
|
34
|
+
def handle_foo(event)
|
35
|
+
event_log << event
|
36
|
+
end
|
37
|
+
|
38
|
+
def handle_bar(event)
|
39
|
+
event_log << event
|
40
|
+
end
|
41
|
+
|
42
|
+
def handle_baz(event)
|
43
|
+
event_log << event
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
klass = IfCodeGenDispatch
|
48
|
+
event = Struct.new(:name, :source, :args)
|
49
|
+
|
50
|
+
# Cheating here, because Opal does not support method_added hook yet
|
51
|
+
klass.method_added_cheat(:handle_foo)
|
52
|
+
klass.method_added_cheat(:handle_bar)
|
53
|
+
klass.method_added_cheat(:handle_baz)
|
54
|
+
|
55
|
+
100_000.times do
|
56
|
+
obj = klass.new
|
57
|
+
obj.call(e1 = event[:foo])
|
58
|
+
obj.call(e2 = event[:bar])
|
59
|
+
obj.call(e3 = event[:baz])
|
60
|
+
obj.call(event[:buz])
|
61
|
+
unless obj.event_log == [e1, e2, e3]
|
62
|
+
raise "#{klass}: #{obj.event_log.inspect}"
|
63
|
+
end
|
64
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
class HardcodedDispatch
|
2
|
+
attr_reader :event_log
|
3
|
+
|
4
|
+
def initialize
|
5
|
+
@event_log = []
|
6
|
+
end
|
7
|
+
|
8
|
+
def call(event)
|
9
|
+
case event.name
|
10
|
+
when :foo
|
11
|
+
handle_foo(event)
|
12
|
+
when :bar
|
13
|
+
handle_bar(event)
|
14
|
+
when :baz
|
15
|
+
handle_baz(event)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
def handle_foo(event)
|
20
|
+
event_log << event
|
21
|
+
end
|
22
|
+
|
23
|
+
def handle_bar(event)
|
24
|
+
event_log << event
|
25
|
+
end
|
26
|
+
|
27
|
+
def handle_baz(event)
|
28
|
+
event_log << event
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
klass = HardcodedDispatch
|
33
|
+
event = Struct.new(:name, :source, :args)
|
34
|
+
|
35
|
+
100_000.times do
|
36
|
+
obj = klass.new
|
37
|
+
obj.call(e1 = event[:foo])
|
38
|
+
obj.call(e2 = event[:bar])
|
39
|
+
obj.call(e3 = event[:baz])
|
40
|
+
obj.call(event[:buz])
|
41
|
+
unless obj.event_log == [e1, e2, e3]
|
42
|
+
raise "#{klass}: #{obj.event_log.inspect}"
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
class SendDispatch
|
2
|
+
attr_reader :event_log
|
3
|
+
|
4
|
+
def initialize
|
5
|
+
@event_log = []
|
6
|
+
end
|
7
|
+
|
8
|
+
def call(event)
|
9
|
+
handler_name = "handle_#{event.name}"
|
10
|
+
__send__(handler_name, event) if respond_to?(handler_name)
|
11
|
+
end
|
12
|
+
|
13
|
+
def handle_foo(event)
|
14
|
+
event_log << event
|
15
|
+
end
|
16
|
+
|
17
|
+
def handle_bar(event)
|
18
|
+
event_log << event
|
19
|
+
end
|
20
|
+
|
21
|
+
def handle_baz(event)
|
22
|
+
event_log << event
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
klass = SendDispatch
|
27
|
+
event = Struct.new(:name, :source, :args)
|
28
|
+
|
29
|
+
100_000.times do
|
30
|
+
obj = klass.new
|
31
|
+
obj.call(e1 = event[:foo])
|
32
|
+
obj.call(e2 = event[:bar])
|
33
|
+
obj.call(e3 = event[:baz])
|
34
|
+
obj.call(event[:buz])
|
35
|
+
unless obj.event_log == [e1, e2, e3]
|
36
|
+
raise "#{klass}: #{obj.event_log.inspect}"
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,57 @@
|
|
1
|
+
class SendTableDispatch
|
2
|
+
attr_reader :event_log
|
3
|
+
|
4
|
+
def initialize
|
5
|
+
@event_log = []
|
6
|
+
end
|
7
|
+
|
8
|
+
def self.method_added_cheat(method_name)
|
9
|
+
if method_name.to_s =~ /^handle_(.+)$/
|
10
|
+
handler_methods[$1.to_sym] = method_name.to_sym
|
11
|
+
end
|
12
|
+
# Cheating here, because Opal does not support method_added hook yet
|
13
|
+
# Uncomment the super below when it does:
|
14
|
+
# super
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.handler_methods
|
18
|
+
@handler_methods ||= {}
|
19
|
+
end
|
20
|
+
|
21
|
+
def call(event)
|
22
|
+
if (handler_method = self.class.handler_methods[event.name])
|
23
|
+
__send__(handler_method, event)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
def handle_foo(event)
|
28
|
+
event_log << event
|
29
|
+
end
|
30
|
+
|
31
|
+
def handle_bar(event)
|
32
|
+
event_log << event
|
33
|
+
end
|
34
|
+
|
35
|
+
def handle_baz(event)
|
36
|
+
event_log << event
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
klass = SendTableDispatch
|
41
|
+
event = Struct.new(:name, :source, :args)
|
42
|
+
|
43
|
+
# Cheating here, because Opal does not support method_added hook yet
|
44
|
+
klass.method_added_cheat(:handle_foo)
|
45
|
+
klass.method_added_cheat(:handle_bar)
|
46
|
+
klass.method_added_cheat(:handle_baz)
|
47
|
+
|
48
|
+
100_000.times do
|
49
|
+
obj = klass.new
|
50
|
+
obj.call(e1 = event[:foo])
|
51
|
+
obj.call(e2 = event[:bar])
|
52
|
+
obj.call(e3 = event[:baz])
|
53
|
+
obj.call(event[:buz])
|
54
|
+
unless obj.event_log == [e1, e2, e3]
|
55
|
+
raise "#{klass}: #{obj.event_log.inspect}"
|
56
|
+
end
|
57
|
+
end
|