r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[!REBOL3-OLD1]

Vladimir
28-Apr-2009
[13666]
Error: "cannot parse the Gui dialect at: 'ts read-string main.r button 
Huge"

And thanks, load-gui did the job :)
Steeve
28-Apr-2009
[13667x3]
Actualy, load-gui is not requested if you manage yourself gobs and 
events.
You just have to open the event port and add your handler into.
This is the very minimalist event handler i use to do my tests on 
gobs and events.
then, just add your gobs into the main screen gob

set 'screen system/view/screen-gob
unless system/view/event-port [
	system/view/event-port: open [scheme: 'event]
]
system/view/event-port/awake: func [event /local gob offset ev][
	ev: map-event event
	gob: ev/gob 
	offset: ev/offset 
	switch event/type [
		move [...]
		up [...]
		down [...]
		...
	]
	tail? screen
]

append screen make gob! [...]
do-events
and a show screen before the do-events, indeed
BrianH
28-Apr-2009
[13670]
Gabriele, all I have is a memory of Carl saying so, and that memory 
is likely 1.5+ years old, from back in the early days of R3 (2007).
Steeve
28-Apr-2009
[13671]
My God... path notation (with parents) is faster than PICK  to get 
a value from a serie with a calculated index, even in the current 
R2.

t/(x) faster than pick t x


I was always thinking  the reverse since a while (true in older R2 
release).
How may this happen to me, i'm fooled...
[unknown: 5]
28-Apr-2009
[13672]
I discovered in the middle of Tretbase development that (first, second, 
third, etc...) were faster than pick also.
PeterWood
28-Apr-2009
[13673x3]
And the using parens is comparatively slow:

>> fastest [s/(++ i)] [++ i s/:i]

The first code took 0:00:00.005777

The second code took 0:00:00.004147


>> fastest [s/(random 26)] [j: random 26 s/:j]

The first code took 0:00:00.007947

The second code took 0:00:00.005672
..in R3
but perhaps not in R2:

>> fastest [s/(random 26)] [j: random 26 s/:j]

The first code took 0:00:00.016884
The second code took 0:00:00.024865


>> fastest [s/(i: i + 1)] [i: i + 1 s/:i]

The first code took 0:00:00.021479

The second code took 0:00:00.017246
Graham
28-Apr-2009
[13676]
I tend to use 'pick because at least I get none back and not an error!
PeterWood
28-Apr-2009
[13677]
That's one of the changes in R3:

>> s

== "abcdefghijklmnopqrstuvwxyz"


>> s/27

== none
Steeve
28-Apr-2009
[13678x5]
what i don't understand, it that:
>> dt [loop 1000000 [x: x + 1 pick t x]]
== 0:00:00.706

>> dt [loop 1000000 [pick t x + 1]]
== 0:00:00.521
when using DP, i can see that the second case do much more evaluations 
than the first one.
How can this be possible ?
it's illogic Mister Spok,
so doing:
>> ++ x  t/:x
is to 2 times faster than:
>> pick t x + 1

Astounding...
in the past PICK was the fastest method to deal with calculated indexes
Steeve
29-Apr-2009
[13683]
Geez... i have to rewite a bunch of scripts beacause of that
Maxim
29-Apr-2009
[13684x2]
but does t/:x still return none when the index doesn't exist? cause 
that is the main advantage of pick for me...
by the term "still" above, I really mean when compared to the pick 
method.
Steeve
29-Apr-2009
[13686x4]
Perter showed you that is the case now in R3.
t/:x == none
if the index X doesn't exist in T
*Peter
So i can make this announce.
PICK is USELESS now in R3, don't ever use
... it  anymore
Anton
29-Apr-2009
[13690]
Except if you don't want functions evaluated.
Steeve
29-Apr-2009
[13691]
uh !?
Anton
29-Apr-2009
[13692]
b: reduce [does [print "hi"]]
Ladislav
29-Apr-2009
[13693]
Here are my results:

>> include %timblk.r
== 1.55177304964539E-2
>> x: 1
== 1
>> t: [1]
== [1]
>> t/:x
== 1
>> t/(x)
== 1
>> pick t x
== 1
>> time-block [t/:x] 0,05
== 4.09841537475586E-7
>> time-block [t/(x)] 0,05
== 4.84228134155273E-7
>> time-block [pick t x] 0,05
== 2.98023223876953E-7

showing, that PICK is the fastest
DideC
29-Apr-2009
[13694x3]
Steeve: you are not executing the same thing : in the second case, 
x does not advance it's always x +1 with x static. In the first case 
x is incrementing so the pick is not the same at each loop, so it 
depends of t length.

>> x: 1
== 1


>> t: "sldfhg ksdjlfgh sjkdfhgsjkdfhgjksdhfgjkhsdfjkghsdjkfhgkjdhfgjkdghfdjkh"

== {sldfhg ksdjlfgh sjkdfhgsjkdfhgjksdhfgjkhsdfjkghsdjkfhgkjdhfgjkdghfdjkh}

>> dt [loop 1000000 [x: x + 1 pick t x]]
== 0:00:00.406

>> dt [loop 1000000 [pick t x: x + 1]]
== 0:00:00.359

>> dt [loop 1000000 [pick t ++ x]]
== 0:00:00.265
Here, only the length of the code block is explaining the time difference 
(7, 6 or only 4 instructions to interpret).
So, if the following is faster it's because the code block evaluation 
take less time IMO (3 instructions) :

>> x: 1 dt [loop 1000000 [t/(++ x)]]
== 0:00:00.172
PeterWood
29-Apr-2009
[13697x2]
Ladislav: I get different results from you. I'm running A49 on Mac 
OS X:

>> fastest [t/(x)] [pick t x]

The first code took 0:00:00.003794

The second code took 0:00:00.004753

>> fastest [t/:x] [pick t x]

The first code took 0:00:00.002759

The second code took 0:00:00.004285

What OS did you run your tests under?
By the way, it is probably far too early to come to any conclusions 
about the relative speeds of different functions in R3 as I believe 
the code has not been optimised yet.
Gabriele
29-Apr-2009
[13699]
Brian: then my memory is that R3's value slots are not fixed size 
any more, because they will be bigger on 64bit systems, but the current 
version is still 16 bytes per slot. so, you can't trust it being 
that way across versions, but i don't think there are versions that 
use more memory yet.
Ladislav
29-Apr-2009
[13700]
my OS: Windows XP Prof SP3
Steeve
29-Apr-2009
[13701x2]
Didec, i have the same results than Peter with the A49.
And what you're saying is not the problem i pointed.

See, there something strange with the number of evaluations done.

>> dp [loop 1000000 [pick t x + 1]]
== make object! [
    timer: 517292
    evals: 4000011
    eval-natives: 2000004

>> dp [loop 1000000 [t/(x + 1)]]
== make object! [
    timer: 350263
    evals: 3000011
    eval-natives: 1000004


So the conclusion is that evaluating a path don't  follow the same 
scheme than a block evaluation.
actually resolving a path is faster than calling a native function, 
it was not the case in the past
Ladislav
29-Apr-2009
[13703x3]
my Linux results (Mepis 6) show the same pattern as Windows XP
aha, you are using A49, sorry
A49 yields:

>> time-block [t/:x] 0,05
== 1.23858451843262e-007

>> time-block [t/(x)] 0,05
== 1.9371509552002e-007

>> time-block [pick t x] 0,05
== 4.35829162597656e-007
Pekr
29-Apr-2009
[13706]
So why is 'pick so much slower?
Ladislav
29-Apr-2009
[13707x2]
It may be caused by the change in function algorithm passing, which 
is more complicated, due to multithreading support
algorithm - sorry, I mean argument
Pekr
29-Apr-2009
[13709]
It would be good to probably ask Carl on Chat, no?
BrianH
29-Apr-2009
[13710x2]
Gabriele, thanks, I trust your memory better than mine about this. 
This is definitely a good reason why Carl is trying to do Rebin before 
he releases the host code - reducing direct access to internal data 
structures.
So why is 'pick so much slower?

 It might be because of the overhead of looking up the word 'pick 
 to get the function :pick every time, same as in R2. It's not that 
 PICK is slower, it's that path decoding is drastically faster in 
 R3 than it is in R2.
[unknown: 5]
29-Apr-2009
[13712x2]
Is REBOL3 going to integrate into the browser at some point?
It seems that was always promised but I don't see where that is becoming 
a reality.
BrianH
29-Apr-2009
[13714]
Remember that you asked that question before you ever complain about 
how we've been working on security lately instead of (pet bug). We've 
been catching a lot of flack lately for working on changes to the 
security model, changes that are necessary to make a browser plugin 
that won't get marked as malware. This was the original reason why 
R3 was started :)
Henrik
29-Apr-2009
[13715]
Ladislav, I'd like to make your article on Identity into a cookbook 
recipe, so it gets an official listing in the cookbooks list, so 
people can find it. Where do you think it would fit on this page:

http://www.rebol.net/cookbooks/