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

World: r3wp

[Core] Discuss core issues

Steeve
18-Dec-2008
[11544]
in the past i found something...
BrianH
18-Dec-2008
[11545]
It's native code.
Steeve
18-Dec-2008
[11546]
perhaps it's the scheme to be exact
BrianH
18-Dec-2008
[11547]
You might be thinking of one of these:
>> first system/schemes

== [self default Finger Whois Daytime SMTP ESMTP POP IMAP HTTP FTP 
NNTP HTTPS]
[unknown: 5]
18-Dec-2008
[11548x2]
So what you really mean Steeve is that read-io is faster than copy 
correct?
That would make sense since read-io is lower level
Steeve
18-Dec-2008
[11550]
i think it is
[unknown: 5]
18-Dec-2008
[11551]
I never check to see how significant the difference was though.  
I might try  a test on a million records or so
BrianH
18-Dec-2008
[11552]
I have got to backport the R3 profiling functions to R2 :(
[unknown: 5]
18-Dec-2008
[11553x2]
Would be nice Brian but I got good ole stats/evals
speaking of backporting is 2.7.6 the end or is 2.7.7 still a possibility?
BrianH
18-Dec-2008
[11555x2]
Further R2 releases will wait until after the R3 developer release, 
but they are coming.
The R3 profiling functions are wrappers around the R3 stats, so I 
just have to translate that to the R2 stats.
Steeve
18-Dec-2008
[11557]
i think that in the past i saw the  source of the file-handler even 
if i can't find it anymore in my sources.

i have the sources of the handlers of other shemes in some proto 
scripts delivred with the commercial version of view.
But nothing else... i loose my memory...
[unknown: 5]
18-Dec-2008
[11558x3]
read-io shouldn't be used with /seek it appears.
in fact they should make it so that  it CAN'T be.
need it to throw an error  or something.
Steeve
18-Dec-2008
[11561]
why ? i use it with /seek as well
[unknown: 5]
18-Dec-2008
[11562x14]
how many characters do you attempt to read each time?
seems with see you only get 15 characters to fill the buffer
see = seek
pass it a greater number and it will still only return 15
works ok with direct though
I think I ran into this problem before
Gonna check Rambo.
Ahhhh, I see.  I just discovered something.
Looks like an empty string is about 16 bytes
Better becareful to size your buffer when using read-io.
It doesn't expand beyond a default of 15 characters unless you define 
it as such.
So in other words if you set your bufrer as just:
buffer: "" then you going to only get 15 chars back.
So instead you need to define it as large as needed:
BrianH
18-Dec-2008
[11576]
Well, at least it doesn't overflow :)
[unknown: 5]
18-Dec-2008
[11577x2]
buffer: make string! 1024
Yeah true Brian, and maybe that is why.
Steeve
18-Dec-2008
[11579]
i give you a script i used to profile the ideal size of the buffer 
used with read-io to have the best perfs.
On my computer the best size for the buffer is 8ko or 16ko.

REBOL []
f: open/seek/binary %large.dta

foreach len [64 128 256 1024 2048 4096 8192 10240 16384 32768 65536 
131072] [

	f/state/index: 0		;*** Problème quand on emploie read-io :
					;*** apparement c'est un bug, par défaut l'index est à 1
					;*** du coup, le premier octet n'est jamais lu
	

 buff: make binary! len + 1	;*** Encore un bizarerie, si le buffer 
 a exactement
					;*** la taille voulue, read-io lit un octet de moins
	n: 0
	recycle
	t: now/time/precise

 while [0 < read-io f buff len] [n: n + 1 clear buff f/state/index: 
 f/state/index + len]
	print [len tab v: now/time/precise - t tab v / n tab n]
]

close f
halt
[unknown: 5]
18-Dec-2008
[11580x3]
See your declaring the size of your buffer so wouldn't have seen 
the other problem.
you don't need the /binary switch with seek in 2.7.6
it is /binary by default.
Steeve
18-Dec-2008
[11583x2]
i know
in fact it's depending of the type of the buffer
[unknown: 5]
18-Dec-2008
[11585]
yeah that is true - which is very cool about REBOL.
Steeve
18-Dec-2008
[11586]
i noticed too, that your buffer must be size of the requested size 
+ 1 byte, if not you get some errors
[unknown: 5]
18-Dec-2008
[11587x3]
I copy data from a port using /seek and simply do-    to-block port-data 
and need no other conversion.
That is probably why it stopped at 15.
I think index was at 1
Steeve
18-Dec-2008
[11590]
the index is zero based, don't forget
[unknown: 5]
18-Dec-2008
[11591]
Nope - still reads just 15
BrianH
18-Dec-2008
[11592]
Requested size + 1 or more bytes.
[unknown: 5]
18-Dec-2008
[11593]
yeah I was checking empty buffer