[ALLY] New View 0.10.34 Re:(2)
From: jeff:rebol at: 25-Sep-2000 10:56
> Hi,
>
> the crash still there:
>
> h: make hash! 0 insert h copy "0123456789" h recycle
> insert h copy "0123456789"
>
> CRASH!
>
> Regards
> Ladislav
Apparently the windows build that went out wasn't fully up to
date. The one posted today has happy hash in it.
Here's a little benchmark that shows (in a pretty way) how
hashes are much faster for searches than blocks:
REBOL [
Title: "Hash vs. Block"
]
blk: make block! 10'000
results: copy []
repeat i 10'000 [
append blk stuff: reduce [key: form i i]
if 0 = (i // 1'000) [
hash: make hash! blk
tb1: now/time
repeat j i [val: select blk form j]
tb2: now/time
th1: now/time
repeat j i [val: select hash form j]
th2: now/time
append/only results reduce [
form i form (tb2 - tb1) form (th2 - th1)
]
]
]
ss: stylize [ tt: text 0.0.0 font [shadow: none]]
view layout [
styles ss
backdrop 10.20.90 title "Block vs. Hash"
list 300x20 [
space 0x0 origin 0x0 across
backdrop 10.200.10
tt "Size" 100x16
tt "Block Select" 100x16
tt "Hash Select" 100x16
]
guide
ll: list 300x230 [
space 0x0 origin 0x0 across
tt 100x16 tt 100x16 tt 100x16 tt 100x16
] data results
]