[#316551] "ensure" hiding actual error — Nit Khair <sentinel.2001@...>

In my main program I have a "begin ensure end".

19 messages 2008/10/01
[#316566] Re: "ensure" hiding actual error — "Robert Klemme" <shortcutter@...> 2008/10/01

2008/10/1 Nit Khair <sentinel.2001@gmx.com>:

[#316570] Re: "ensure" hiding actual error — Nit Khair <sentinel.2001@...> 2008/10/01

Robert Klemme wrote:

[#316579] Re: "ensure" hiding actual error — "Robert Klemme" <shortcutter@...> 2008/10/01

2008/10/1 Nit Khair <sentinel.2001@gmx.com>:

[#316583] Re: "ensure" hiding actual error — Nit Khair <sentinel.2001@...> 2008/10/01

Robert Klemme wrote:

[#316585] Re: "ensure" hiding actual error — "Thomas B." <tpreal@...> 2008/10/01

Nit Khair wrote:

[#316589] Re: "ensure" hiding actual error — "Robert Klemme" <shortcutter@...> 2008/10/01

2008/10/1 Thomas B. <tpreal@gmail.com>:

[#316617] Ordered hash hack for < ruby 1.9? — Ben Johnson <bjohnson@...>

I am having an issue testing my code because hashes don't have a

22 messages 2008/10/01
[#316620] Re: Ordered hash hack for < ruby 1.9? — "Patrick Doyle" <wpdster@...> 2008/10/01

Why not iterate over myhash.keys.sort instead of just myhash.keys?

[#316704] Problem extending (adding methods) to class — Nit Khair <sentinel.2001@...>

I am trying to extend a class developed by someone else (its from the

24 messages 2008/10/02
[#316707] Re: Problem extending (adding methods) to class — Nit Khair <sentinel.2001@...> 2008/10/02

Nit Khair wrote:

[#316723] Is Assignment in a Conditional an Idiom? — worthee@...

Hi

19 messages 2008/10/02

[#316839] class << self — "Patrick Doyle" <wpdster@...>

Sorry if this is a FAQ, but I was just looking at some Ruby code and

14 messages 2008/10/03

[#316847] Making/Compiling Gems on Windows with MinGW — Cayce Balara <house@...>

Whenever I try to install a gem that doesn't have a precompiled binary

11 messages 2008/10/03

[#316907] stream closed (IOError) — "Eric Will" <rakaur@...>

This code:

17 messages 2008/10/05
[#316910] Re: stream closed (IOError) — Yukihiro Matsumoto <matz@...> 2008/10/05

Hi,

[#316920] Re: stream closed (IOError) — "Eric Will" <rakaur@...> 2008/10/05

Line 231 is the @socket.close line. Nothing gets done to the socket

[#316925] Re: stream closed (IOError) — Yukihiro Matsumoto <matz@...> 2008/10/05

Hi,

[#316926] Re: stream closed (IOError) — "Eric Will" <rakaur@...> 2008/10/05

On Sun, Oct 5, 2008 at 11:46 AM, Yukihiro Matsumoto <matz@ruby-lang.org> wrote:

[#316927] Re: stream closed (IOError) — Iki Baz Castillo <ibc@...> 2008/10/05

El Domingo, 5 de Octubre de 2008, Eric Will escribi=F3:

[#316968] Ruby lacks atfork : The evil that lives in fork... — John Carter <john.carter@...>

Consider this simple usage of Thread and Process....

12 messages 2008/10/06

[#316978] Concurent (using threads) slower than sequential -doubt — Carlos Ortega <caof2005@...>

Hi Folks.

10 messages 2008/10/06

[#316988] Problem with comparing huge amount of strings — Jan Fischer <janfischer@...>

Hello together,

11 messages 2008/10/06

[#317122] Demand that Obama release his college records! Where is the media? — Micky <guuwwe@...>

Why is it important to see Obama's college records? Because the media

11 messages 2008/10/07

[#317126] Ruby with Oracle forward slash error — Sam Sang <younoeme@...>

Hi,

12 messages 2008/10/07

[#317127] Looking for more Ruby-like way to create an array — Steve Nicholson <ssteve@...>

I'm creating an array that is the result of the members of another array

11 messages 2008/10/07

[#317326] Thread: super should be first line or last line? — "christoforever@..." <christoforever@...>

While playing around with ruby threads I noticed that if you dont call

11 messages 2008/10/10

[#317337] Modular Arithmetic (#179) — Matthew Moss <matt@...>

-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D=

15 messages 2008/10/10

[#317395] Automatic ClassLoader (to eliminate 'require') — Alexey Petrushin <axyd80@...>

Hello!

17 messages 2008/10/11
[#317397] Re: Automatic ClassLoader (to eliminate 'require') — Erik Veenstra <erikveen@...> 2008/10/11

module AutoRequire

[#317402] Re: Automatic ClassLoader (to eliminate 'require') — Alexey Petrushin <axyd80@...> 2008/10/11

Thanks! It works! :)

[#317403] Re: Automatic ClassLoader (to eliminate 'require') — "Thomas B." <tpreal@...> 2008/10/11

Alexey Petrushin wrote:

[#317422] Sample for Metaprogramming — relzne@...

Hi.

13 messages 2008/10/11

[#317452] Updating Ruby 1.8.6 to 1.8.6-p287 in Debian 4 — The Neurochild <neurochild@...>

Hi

21 messages 2008/10/12

[#317502] Sorting help — Binh Ly <binh@...>

Hello All,

19 messages 2008/10/12

[#317601] Using DBI and MySQL gems — Owein Herrmann <oherrmann@...>

Quick question:

14 messages 2008/10/13

[#317758] Big endian convention in Ruby — Zangief Ief <z4n9ief@...>

Hello,

18 messages 2008/10/16
[#317767] Re: Big endian convention in Ruby — Robert Klemme <shortcutter@...> 2008/10/16

On 16.10.2008 10:26, Zangief Ief wrote:

[#317772] Re: Big endian convention in Ruby — Zangief Ief <z4n9ief@...> 2008/10/16

Thanks you for you answer.

[#317800] Re: Big endian convention in Ruby — Brian Candler <b.candler@...> 2008/10/16

Zangief Ief wrote:

[#317820] Re: Big endian convention in Ruby — Robert Klemme <shortcutter@...> 2008/10/16

On 16.10.2008 15:25, Brian Candler wrote:

[#317936] Re: Big endian convention in Ruby — Zangief Ief <z4n9ief@...> 2008/10/17

Thank you all for your help.

[#317759] How to go from a ruby script to a working website? — Ralph Wood <esmero@...>

As you've probably guessed by the title, total newbie here.

12 messages 2008/10/16

[#317769] A Ruby block question — David Trasbo <davidtrasbo@...>

I am in need of making a method that accepts a block. It basicly needs

23 messages 2008/10/16
[#317770] Re: A Ruby block question — Stefano Crocco <stefano.crocco@...> 2008/10/16

Alle Thursday 16 October 2008, David Trasbo ha scritto:

[#317773] Re: A Ruby block question — David Trasbo <davidtrasbo@...> 2008/10/16

Stefano Crocco wrote:

[#317779] Re: A Ruby block question — Stefano Crocco <stefano.crocco@...> 2008/10/16

Alle Thursday 16 October 2008, David Trasbo ha scritto:

[#317780] Re: A Ruby block question — David Trasbo <davidtrasbo@...> 2008/10/16

Stefano Crocco wrote:

[#317776] I found way to protect Source Code! :) — Alexey Petrushin <axyd80@...>

Hello!

34 messages 2008/10/16
[#317859] Re: I found way to protect Source Code! :) — Ade Inovica <adrian.teasdale@...> 2008/10/16

Interesting solution. May I also suggest that you try

[#317869] Re: I found way to protect Source Code! :) — Mike Gold <mike.gold.4433@...> 2008/10/16

Ade Inovica wrote:

[#317886] Re: I found way to protect Source Code! :) — Sasha Bee <rubyman77@...> 2008/10/17

Mike Gold wrote:

[#317956] Re: I found way to protect Source Code! :) — "ara.t.howard" <ara.t.howard@...> 2008/10/17

[#317878] instance counter — Pierre Lebrun <anthonylebrun@...>

Please forgive the trite nature of this question, I'm new to ruby and OO

21 messages 2008/10/17
[#317880] Re: instance counter — Tommy Nordgren <tommy.nordgren@...> 2008/10/17

[#317883] Re: instance counter — Mike Gold <mike.gold.4433@...> 2008/10/17

Tommy Nordgren wrote:

[#317903] Re: instance counter — Robert Klemme <shortcutter@...> 2008/10/17

On 17.10.2008 07:19, Mike Gold wrote:

[#317938] Error Exception if script doesn't run — jackster the jackle <johnsheahan@...>

I need to know if my script fails to run for any reason and capture the

20 messages 2008/10/17
[#317941] Re: Error Exception if script doesn't run — Brian Candler <b.candler@...> 2008/10/17

jackster the jackle wrote:

[#317967] Re: Error Exception if script doesn't run — jackster the jackle <johnsheahan@...> 2008/10/17

I notice that any shell commands that I have in the script that fail do

[#317972] Re: Error Exception if script doesn't run — Joel VanderWerf <vjoel@...> 2008/10/17

jackster the jackle wrote:

[#317974] Re: Error Exception if script doesn't run — jackster the jackle <johnsheahan@...> 2008/10/17

It seems to work but not for this command, perhaps since scp gets

[#317979] Re: Error Exception if script doesn't run — Tim Hunter <TimHunter@...> 2008/10/18

jackster the jackle wrote:

[#317992] Re: Error Exception if script doesn't run — jackster the jackle <johnsheahan@...> 2008/10/18

Tim Hunter wrote:

[#317966] Counting — Tom Clarke <thomas.clarke08@...>

How would i go about making Ruby count to say 1000 usin only multiples

18 messages 2008/10/17

[#318286] Trollop 1.10 released — William Morgan <wmorgan-ruby-talk@...>

Trollop version 1.10 has been released!

12 messages 2008/10/22

[#318309] Is there a method_eval or similar thing ? — Nit Khair <sentinel.2001@...>

I have a method called askyesno which takes a string and returns whether

13 messages 2008/10/22

[#318323] What exactly does "rubyish" or "ruby way" mean? — Nit Khair <sentinel.2001@...>

Over the last month I have been reading a lot of blogs, searching, going

12 messages 2008/10/22

[#318509] How to tell if two paths point to the same file? — Kenneth McDonald <kenneth.m.mcdonald@...>

I've tried using File.expand_path to normalize path names, but this

12 messages 2008/10/24

[#318523] RubyMacros 0.1.0 Released — "Caleb Clausen" <vikkous@...>

RubyMacros is a lisp-like macro pre-processor for Ruby. More than just a

15 messages 2008/10/24

[#318552] Join all text files in a folder, with a single line of Ruby code — luisbebop <luisbebop@...>

I did a single line of code in Ruby, which joins all text files in a

26 messages 2008/10/25
[#318556] Re: Join all text files in a folder, with a single line of Ruby code — "William James" <w_a_x_man@...> 2008/10/25

luisbebop wrote:

[#318574] Re: Join all text files in a folder, with a single line of Ruby code — Joel VanderWerf <vjoel@...> 2008/10/25

William James wrote:

[#318607] Re: Join all text files in a folder, with a single line of Ruby code — Nobuyoshi Nakada <nobu@...> 2008/10/26

Hi,

[#318622] Re: Join all text files in a folder, with a single line of Ruby code — Joel VanderWerf <vjoel@...> 2008/10/26

Nobuyoshi Nakada wrote:

[#318640] Re: Join all text files in a folder, with a single line of Ruby code — luisbebop <luisbebop@...> 2008/10/27

> ruby -pe'1' *

[#318641] Re: Join all text files in a folder, with a single line of Ruby code — Joel VanderWerf <vjoel@...> 2008/10/27

luisbebop wrote:

[#318601] Hash.merge_add! extension - how does this code look? — "Greg Hauptmann" <greg.hauptmann.ruby@...>

Hi,

18 messages 2008/10/26
[#318632] Re: Hash.merge_add! extension - how does this code look? — Stefan Rusterholz <apeiros@...> 2008/10/26

Greg Hauptmann wrote:

[#318644] Re: Hash.merge_add! extension - how does this code look? — "Greg Hauptmann" <greg.hauptmann.ruby@...> 2008/10/27

thanks for highlighting this! Is the quickest way to normalise to Array via

[#318655] Re: Hash.merge_add! extension - how does this code look? — Stefan Rusterholz <apeiros@...> 2008/10/27

Greg Hauptmann wrote:

[#318656] Re: Hash.merge_add! extension - how does this code look? — "Greg Hauptmann" <greg.hauptmann.ruby@...> 2008/10/27

I just noticed the code suggested might have a problem when the

[#318721] automatic code conversion from Ruby to C ? — "Axel Etzold" <AEtzold@...>

Dear all,

16 messages 2008/10/27

[#318888] project manager panel in SciTE — Li Chen <chen_li3@...>

Hi all,

14 messages 2008/10/29

[#318896] RubyGems 1.3.1 — Eric Hodel <drbrain@...7.net>

= Announce: RubyGems Release 1.3.1

13 messages 2008/10/29

[#318970] Roguelike project? — Tim Mcd <tmcdowell@...>

Anyone interested in a Roguelike game written in Ruby/Ncurses project?

41 messages 2008/10/30
[#318976] Re: Roguelike project? — Matthew Moss <matt@...> 2008/10/30

> Anyone interested in a Roguelike game written in Ruby/Ncurses project?

[#319050] Re: Roguelike project? — "Michael Fellinger" <m.fellinger@...> 2008/10/31

On Fri, Oct 31, 2008 at 3:42 AM, Matthew Moss <matt@moss.name> wrote:

[#319052] Re: Roguelike project? — Nit Khair <sentinel.2001@...> 2008/10/31

Michael Fellinger wrote:

[#319056] Re: Roguelike project? — "Michael Fellinger" <m.fellinger@...> 2008/10/31

On Sat, Nov 1, 2008 at 1:46 AM, Nit Khair <sentinel.2001@gmx.com> wrote:

[#319287] Re: Roguelike project? — Nit Khair <sentinel.2001@...> 2008/11/03

Michael Fellinger wrote:

[#319393] Re: Roguelike project? — Nit Khair <sentinel.2001@...> 2008/11/04

Nit Khair wrote:

[#319422] Re: Roguelike project? — Nit Khair <sentinel.2001@...> 2008/11/04

Nit Khair wrote:

[#319021] XML builder performance — Xin Zheng <crazygecko@...>

Hi all,

13 messages 2008/10/31

[#319055] How to access to local variables in enclosing scopes? — Yuh-Ruey Chen <maian330@...>

I'm familiar with other popular scripting languages (JS and Python),

34 messages 2008/10/31

[#319094] FFI 0.1.1 (Foreign Function Interface) for Ruby 1.8.6/7 and 1.9 — Charles Oliver Nutter <charles.nutter@...>

The JRuby team is proud to announce the release of FFI for Ruby 1.8.6/7

62 messages 2008/10/31
[#319099] Re: [ANN] FFI 0.1.1 (Foreign Function Interface) for Ruby 1.8.6/7 and 1.9 — Thomas Hurst <tom.hurst@...> 2008/11/01

* Charles Oliver Nutter (charles.nutter@sun.com) wrote:

[#319101] Re: [ANN] FFI 0.1.1 (Foreign Function Interface) for Ruby 1.8.6/7 and 1.9 — Charles Oliver Nutter <charles.nutter@...> 2008/11/01

Thomas Hurst wrote:

[#319113] Re: [ANN] FFI 0.1.1 (Foreign Function Interface) for Ruby 1.8.6/7 and 1.9 — Charles Oliver Nutter <charles.nutter@...> 2008/11/01

Charles Oliver Nutter wrote:

[#319238] Re: [ANN] FFI 0.1.1 (Foreign Function Interface) for Ruby 1.8.6/7 and 1.9 — Sylvain Joyeux <sylvain.joyeux@...> 2008/11/03

On Sat, Nov 01, 2008 at 08:16:39AM +0900, Charles Oliver Nutter wrote:

[#319240] Re: [ANN] FFI 0.1.1 (Foreign Function Interface) for Ruby 1.8.6/7 and 1.9 — Charles Oliver Nutter <charles.nutter@...> 2008/11/03

Sylvain Joyeux wrote:

[#319390] Re: [ANN] FFI 0.1.1 (Foreign Function Interface) for Ruby 1.8.6/7 and 1.9 — Ken Bloom <kbloom@...> 2008/11/04

On Fri, 31 Oct 2008 18:16:39 -0500, Charles Oliver Nutter wrote:

[#319391] Re: [ANN] FFI 0.1.1 (Foreign Function Interface) for Ruby 1.8.6/7 and 1.9 — "Sean O'Halpin" <sean.ohalpin@...> 2008/11/04

On Tue, Nov 4, 2008 at 2:38 PM, Ken Bloom <kbloom@gmail.com> wrote:

[#319395] Re: FFI 0.1.1 (Foreign Function Interface) for Ruby 1.8.6/7 and 1.9 — Nit Khair <sentinel.2001@...> 2008/11/04

Sean O'halpin wrote:

[#319428] Re: FFI 0.1.1 (Foreign Function Interface) for Ruby 1.8.6/7 and 1.9 — Charles Oliver Nutter <charles.nutter@...> 2008/11/04

Nit Khair wrote:

[#319467] Re: FFI 0.1.1 (Foreign Function Interface) for Ruby 1.8.6/7 and 1.9 — "Sean O'Halpin" <sean.ohalpin@...> 2008/11/05

On Tue, Nov 4, 2008 at 7:02 PM, Charles Oliver Nutter

[#319468] Re: FFI 0.1.1 (Foreign Function Interface) for Ruby 1.8.6/7 and 1.9 — Charles Oliver Nutter <charles.nutter@...> 2008/11/05

Sean O'Halpin wrote:

[#319535] Re: FFI 0.1.1 (Foreign Function Interface) for Ruby 1.8.6/7 and 1.9 — "Sean O'Halpin" <sean.ohalpin@...> 2008/11/05

On Wed, Nov 5, 2008 at 4:34 AM, Charles Oliver Nutter

[#319538] Re: FFI 0.1.1 (Foreign Function Interface) for Ruby 1.8.6/7 and 1.9 — Nit Khair <sentinel.2001@...> 2008/11/05

Sean O'halpin wrote:

Re: array comparison

From: Robert Klemme <shortcutter@...>
Date: 2008-10-31 17:19:08 UTC
List: ruby-talk #319054
On 31.10.2008 11:21, Sarcar, Shourya C (GE Healthcare) wrote:
>> -----Original Message-----
>> From: Robert Klemme [mailto:shortcutter@googlemail.com] 
>> Sent: Friday, October 31, 2008 12:04 AM
>> To: ruby-talk ML
>> Subject: Re: array comparison
>>
>> The comparison is a bit unfair since you include the build 
>> time for the structure in case of Hash but not for the Array. 
>>  You should at least also compare just the intersection time. 
>>  And while you're at it you can also add Set to the mix. :-)
> 
> 
> Interesting discussion.
> 
> I wrote a small program to compare Array intersection to Set
> intersection.
> I noticed that for smaller sets (~10 ** 3), Array is much faster that
> Set, sometimes upto 5x.
> As the set size grows, they seem to converge (~10 ** 7, 100 million)
> 
> # Program to compare timings for intersections
> require 'set'
> 
> n = 10000
> while (n <= 10 ** 7) do 
> 	c = Array.new(n) {rand n}.uniq
> 	d = Array.new(n) {rand n}.uniq
> 
> 	# Native array intersection
> 	t0 = Time.now
> 	cd = c & d
> 	t1 = Time.now
> 	printf("Array | n = %d : %d intersects found in %f
> seconds\n",n,cd.size,t1-t0)
> 	
> 	# Convert array to Set objects and perform intersection
> 	c = c.to_set
> 	d = d.to_set
> 	t2 = Time.now
> 	cd = c & d
> 	t3 = Time.now
> 	printf("Set   | n = %d : %d intersects found in %f
> seconds\n",n,cd.size,t3-t2)
> 	printf("Ratio of Set/Array intersect time =
> %.2f\n",(t3-t2)/(t1-t0))
> 
> 	n = 2 * n
> end

Some things are noteworthy about your program:

  - It has a large intersection, i.e. roughly 50% on average.  This may 
be different for other scenarios.

  - You use Fixnums which compare pretty fast, you can expect to reach 
break even earlier when using other types.

I have taken the liberty to extend your test program a bit changing 
those two parameters mentioned above and you can see significant 
differences. :-)

Kind regards

	robert


Attachments (2)

i2.rb (1.16 KB, text/x-ruby)
require 'set'

constr = [
  lambda do |n|
  [
    Array.new(n) {rand n}.uniq,
    Array.new(n) {rand(n) + (n*0.9).to_i}.uniq
  ]
  end,
    lambda do |n|
    [
      Array.new(n) {"#{rand n}" << ("*" * 100_000)}.uniq,
      Array.new(n) {"#{rand(n) + (n*0.9).to_i}" << ("*" * 100_000)}.uniq
    ]
    end
]

2.times do |run|
  puts "=== run #{run + 1} ========================================================"
  constr.each_with_index do |creat, idx|
    puts "--- construct #{idx} --------------------------------------------------------"
    n = 1
    loop do 
      c, d = creat[n]

      # Native array intersection
      t0 = Time.now
      cd = c & d
      t1 = Time.now
      printf("Array | n = %d : %d intersects found in %f seconds\n",n,cd.size,t1-t0)

      # Convert array to Set objects and perform intersection
      c = c.to_set
      d = d.to_set
      t2 = Time.now
      cd = c & d
      t3 = Time.now
      printf("Set   | n = %d : %d intersects found in %f seconds\n",n,cd.size,t3-t2)

      ratio = (t3-t2)/(t1-t0)
      printf("Ratio of Set/Array intersect time = %.2f\n",ratio)

      n *= 2
      break if n > 100 && ratio > 0.1 && ratio < 0.9
    end
  end
end
output.txt (8.83 KB, text/plain)
=== run 1 ========================================================
--- construct 0 --------------------------------------------------------
Array | n = 1 : 1 intersects found in 0.000000 seconds
Set   | n = 1 : 1 intersects found in 0.000000 seconds
Ratio of Set/Array intersect time = nan
Array | n = 2 : 0 intersects found in 0.000000 seconds
Set   | n = 2 : 0 intersects found in 0.000000 seconds
Ratio of Set/Array intersect time = nan
Array | n = 4 : 1 intersects found in 0.000000 seconds
Set   | n = 4 : 1 intersects found in 0.000000 seconds
Ratio of Set/Array intersect time = nan
Array | n = 8 : 0 intersects found in 0.000000 seconds
Set   | n = 8 : 0 intersects found in 0.000000 seconds
Ratio of Set/Array intersect time = nan
Array | n = 16 : 0 intersects found in 0.000000 seconds
Set   | n = 16 : 0 intersects found in 0.000000 seconds
Ratio of Set/Array intersect time = nan
Array | n = 32 : 1 intersects found in 0.000000 seconds
Set   | n = 32 : 1 intersects found in 0.000000 seconds
Ratio of Set/Array intersect time = nan
Array | n = 64 : 2 intersects found in 0.000000 seconds
Set   | n = 64 : 2 intersects found in 0.000000 seconds
Ratio of Set/Array intersect time = nan
Array | n = 128 : 3 intersects found in 0.000000 seconds
Set   | n = 128 : 3 intersects found in 0.000000 seconds
Ratio of Set/Array intersect time = nan
Array | n = 256 : 13 intersects found in 0.000000 seconds
Set   | n = 256 : 13 intersects found in 0.001000 seconds
Ratio of Set/Array intersect time = inf
Array | n = 512 : 19 intersects found in 0.000000 seconds
Set   | n = 512 : 19 intersects found in 0.001000 seconds
Ratio of Set/Array intersect time = inf
Array | n = 1024 : 38 intersects found in 0.001000 seconds
Set   | n = 1024 : 38 intersects found in 0.001000 seconds
Ratio of Set/Array intersect time = 1.00
Array | n = 2048 : 87 intersects found in 0.001000 seconds
Set   | n = 2048 : 87 intersects found in 0.003000 seconds
Ratio of Set/Array intersect time = 3.00
Array | n = 4096 : 147 intersects found in 0.002000 seconds
Set   | n = 4096 : 147 intersects found in 0.005000 seconds
Ratio of Set/Array intersect time = 2.50
Array | n = 8192 : 344 intersects found in 0.004000 seconds
Set   | n = 8192 : 344 intersects found in 0.010000 seconds
Ratio of Set/Array intersect time = 2.50
Array | n = 16384 : 674 intersects found in 0.008000 seconds
Set   | n = 16384 : 674 intersects found in 0.021000 seconds
Ratio of Set/Array intersect time = 2.62
Array | n = 32768 : 1353 intersects found in 0.015000 seconds
Set   | n = 32768 : 1353 intersects found in 0.046000 seconds
Ratio of Set/Array intersect time = 3.07
Array | n = 65536 : 2605 intersects found in 0.040000 seconds
Set   | n = 65536 : 2605 intersects found in 0.096000 seconds
Ratio of Set/Array intersect time = 2.40
Array | n = 131072 : 5278 intersects found in 0.125000 seconds
Set   | n = 131072 : 5278 intersects found in 0.203000 seconds
Ratio of Set/Array intersect time = 1.62
Array | n = 262144 : 10610 intersects found in 0.327000 seconds
Set   | n = 262144 : 10610 intersects found in 0.416000 seconds
Ratio of Set/Array intersect time = 1.27
Array | n = 524288 : 21003 intersects found in 0.869000 seconds
Set   | n = 524288 : 21003 intersects found in 0.827000 seconds
Ratio of Set/Array intersect time = 0.95
Array | n = 1048576 : 41912 intersects found in 2.059000 seconds
Set   | n = 1048576 : 41912 intersects found in 1.674000 seconds
Ratio of Set/Array intersect time = 0.81
--- construct 1 --------------------------------------------------------
Array | n = 1 : 1 intersects found in 0.002000 seconds
Set   | n = 1 : 1 intersects found in 0.001000 seconds
Ratio of Set/Array intersect time = 0.50
Array | n = 2 : 1 intersects found in 0.003000 seconds
Set   | n = 2 : 1 intersects found in 0.003000 seconds
Ratio of Set/Array intersect time = 1.00
Array | n = 4 : 0 intersects found in 0.003000 seconds
Set   | n = 4 : 0 intersects found in 0.001000 seconds
Ratio of Set/Array intersect time = 0.33
Array | n = 8 : 0 intersects found in 0.011000 seconds
Set   | n = 8 : 0 intersects found in 0.002000 seconds
Ratio of Set/Array intersect time = 0.18
Array | n = 16 : 2 intersects found in 0.013000 seconds
Set   | n = 16 : 2 intersects found in 0.008000 seconds
Ratio of Set/Array intersect time = 0.62
Array | n = 32 : 1 intersects found in 0.026000 seconds
Set   | n = 32 : 1 intersects found in 0.009000 seconds
Ratio of Set/Array intersect time = 0.35
Array | n = 64 : 3 intersects found in 0.054000 seconds
Set   | n = 64 : 3 intersects found in 0.020000 seconds
Ratio of Set/Array intersect time = 0.37
=== run 2 ========================================================
--- construct 0 --------------------------------------------------------
Array | n = 1 : 1 intersects found in 0.000000 seconds
Set   | n = 1 : 1 intersects found in 0.000000 seconds
Ratio of Set/Array intersect time = nan
Array | n = 2 : 1 intersects found in 0.000000 seconds
Set   | n = 2 : 1 intersects found in 0.000000 seconds
Ratio of Set/Array intersect time = nan
Array | n = 4 : 1 intersects found in 0.000000 seconds
Set   | n = 4 : 1 intersects found in 0.000000 seconds
Ratio of Set/Array intersect time = nan
Array | n = 8 : 1 intersects found in 0.000000 seconds
Set   | n = 8 : 1 intersects found in 0.000000 seconds
Ratio of Set/Array intersect time = nan
Array | n = 16 : 1 intersects found in 0.000000 seconds
Set   | n = 16 : 1 intersects found in 0.000000 seconds
Ratio of Set/Array intersect time = nan
Array | n = 32 : 1 intersects found in 0.000000 seconds
Set   | n = 32 : 1 intersects found in 0.000000 seconds
Ratio of Set/Array intersect time = nan
Array | n = 64 : 5 intersects found in 0.000000 seconds
Set   | n = 64 : 5 intersects found in 0.000000 seconds
Ratio of Set/Array intersect time = nan
Array | n = 128 : 7 intersects found in 0.000000 seconds
Set   | n = 128 : 7 intersects found in 0.000000 seconds
Ratio of Set/Array intersect time = nan
Array | n = 256 : 9 intersects found in 0.000000 seconds
Set   | n = 256 : 9 intersects found in 0.000000 seconds
Ratio of Set/Array intersect time = nan
Array | n = 512 : 24 intersects found in 0.000000 seconds
Set   | n = 512 : 24 intersects found in 0.001000 seconds
Ratio of Set/Array intersect time = inf
Array | n = 1024 : 47 intersects found in 0.000000 seconds
Set   | n = 1024 : 47 intersects found in 0.001000 seconds
Ratio of Set/Array intersect time = inf
Array | n = 2048 : 79 intersects found in 0.000000 seconds
Set   | n = 2048 : 79 intersects found in 0.003000 seconds
Ratio of Set/Array intersect time = inf
Array | n = 4096 : 178 intersects found in 0.002000 seconds
Set   | n = 4096 : 178 intersects found in 0.004000 seconds
Ratio of Set/Array intersect time = 2.00
Array | n = 8192 : 322 intersects found in 0.004000 seconds
Set   | n = 8192 : 322 intersects found in 0.010000 seconds
Ratio of Set/Array intersect time = 2.50
Array | n = 16384 : 650 intersects found in 0.008000 seconds
Set   | n = 16384 : 650 intersects found in 0.022000 seconds
Ratio of Set/Array intersect time = 2.75
Array | n = 32768 : 1326 intersects found in 0.015000 seconds
Set   | n = 32768 : 1326 intersects found in 0.046000 seconds
Ratio of Set/Array intersect time = 3.07
Array | n = 65536 : 2626 intersects found in 0.041000 seconds
Set   | n = 65536 : 2626 intersects found in 0.095000 seconds
Ratio of Set/Array intersect time = 2.32
Array | n = 131072 : 5279 intersects found in 0.129000 seconds
Set   | n = 131072 : 5279 intersects found in 0.205000 seconds
Ratio of Set/Array intersect time = 1.59
Array | n = 262144 : 10491 intersects found in 0.334000 seconds
Set   | n = 262144 : 10491 intersects found in 0.403000 seconds
Ratio of Set/Array intersect time = 1.21
Array | n = 524288 : 21031 intersects found in 1.112000 seconds
Set   | n = 524288 : 21031 intersects found in 0.814000 seconds
Ratio of Set/Array intersect time = 0.73
--- construct 1 --------------------------------------------------------
Array | n = 1 : 1 intersects found in 0.001000 seconds
Set   | n = 1 : 1 intersects found in 0.002000 seconds
Ratio of Set/Array intersect time = 2.00
Array | n = 2 : 1 intersects found in 0.003000 seconds
Set   | n = 2 : 1 intersects found in 0.002000 seconds
Ratio of Set/Array intersect time = 0.67
Array | n = 4 : 1 intersects found in 0.004000 seconds
Set   | n = 4 : 1 intersects found in 0.002000 seconds
Ratio of Set/Array intersect time = 0.50
Array | n = 8 : 0 intersects found in 0.007000 seconds
Set   | n = 8 : 0 intersects found in 0.002000 seconds
Ratio of Set/Array intersect time = 0.29
Array | n = 16 : 0 intersects found in 0.013000 seconds
Set   | n = 16 : 0 intersects found in 0.005000 seconds
Ratio of Set/Array intersect time = 0.38
Array | n = 32 : 1 intersects found in 0.024000 seconds
Set   | n = 32 : 1 intersects found in 0.009000 seconds
Ratio of Set/Array intersect time = 0.37
Array | n = 64 : 3 intersects found in 0.055000 seconds
Set   | n = 64 : 3 intersects found in 0.020000 seconds
Ratio of Set/Array intersect time = 0.36

In This Thread

Prev Next