World: r3wp
[!REBOL3]
older newer | first last |
Pekr 8-Feb-2010 [564] | So - for basic traversal, R3 is faster .... for my example .... |
sqlab 8-Feb-2010 [565] | even with my random generated data, the number of parts should be always the same. But you can also parse the same data a few times. Every times it will be parsed in a different number of parts |
Graham 8-Feb-2010 [566] | end is a keyword! |
sqlab 8-Feb-2010 [567] | The data I parse, are oftly in the 10s of MB and more. With R2 I had no problems |
Pekr 8-Feb-2010 [568] | >> start: now/time/precise loop 1000000 [parse "abc^/def^/ghi^/" [s: any [e: newline (append blk copy/part s e) s: | skip]]] now/time/precise - start == 0:00:05.359 |
Graham 8-Feb-2010 [569] | Hmm... tried to parse 4M chars a few times and r2 ran out of memory ... r3 worked fine |
Pekr 8-Feb-2010 [570x2] | There really is some problem: R2: >> start: now/time/precise loop 1000000 [parse "abc^/def^/ghi^/" "^/"] now/time/precise - start == 0:00:00.933 R3: == 0:00:04.259 |
I would curecode it, along with my example, and ask Carl about the possible cause ... | |
sqlab 8-Feb-2010 [572] | I did it already. But your example does not show the real problem. just use my example and you will see why. |
Pekr 8-Feb-2010 [573x4] | it shows very big time penalty ... |
... which does not correspond to my manual parse example above ... | |
WTF? I get strange beeps when running your test code :-) | |
try running following code: c: "" for i 0 255 1 [append c to-char i] I get a beep here .... | |
Graham 8-Feb-2010 [577] | each time I parse the dataset ... I get it alternating between two lengths |
sqlab 8-Feb-2010 [578] | I have no speaker at my pc.) |
Pekr 8-Feb-2010 [579x2] | hmm, we are appending char into string ... who knows what it does internally :-) In charset, there are some escape/control codes, so maybe it causes a beep, I don't know :-) |
I reported the strange beep into CC too ... | |
Graham 8-Feb-2010 [581x2] | I copied the dataset before each parse ... very odd |
Pekr, are you sure it's not just control chars printing to windows console causing beep? | |
Pekr 8-Feb-2010 [583x3] | could be a GC problem? Maybe above "beep" means there might be some memory leak? |
maybe ... who knows ... should not beep .... | |
it surely is about control chars ... | |
Graham 8-Feb-2010 [586] | why should it not beep? |
Gabriele 8-Feb-2010 [587] | Petr, most likely you get the beep when the string is printed to the windows console. |
Pekr 8-Feb-2010 [588] | R2 does not beep (but it has its own console) |
Gabriele 8-Feb-2010 [589x2] | that is, windows does respect the BEL character. |
ie. try print "^(07)" | |
Pekr 8-Feb-2010 [591] | yes, but I am denerved by that beeping :-) |
Graham 8-Feb-2010 [592] | and this is the windows console |
Gabriele 8-Feb-2010 [593] | don't include that char in your tests then, or don't print it out ;) |
Pekr 8-Feb-2010 [594] | Yes, it does so ... I will suggest the ticket dismissal ... |
Graham 8-Feb-2010 [595] | more unnerving is the non reproducible parse! |
Pekr 8-Feb-2010 [596] | Graham - sqlab's code uses random sets, no? What is non reproducible exactly? |
Graham 8-Feb-2010 [597] | parse dataset "^/" returns a different value |
Pekr 8-Feb-2010 [598x2] | for each consetutive run on the same dataset? |
consecutive | |
Graham 8-Feb-2010 [600x2] | length? parse data "^/" |
do that a few times | |
Pekr 8-Feb-2010 [602x2] | >> parse "abc^/def^/ghi^/" "^/" == ["abc" "def" "ghi"] |
I get three value block for each run ... | |
Graham 8-Feb-2010 [604] | on the large set ... not small sets |
Pekr 8-Feb-2010 [605] | OK, I will try ... |
Graham 8-Feb-2010 [606] | he just generates a large set of random chars |
Pekr 8-Feb-2010 [607x3] | strange ... I even tried to do those consecutive parse examples on the copy of data ... the result is still random ... |
I thought that first parse might disrupt the input, which is used for the second parse too. But it does not work even for the copy of the data ... | |
Following code almost kills my DualCore notebook. View exe consumes almost 1GB of RAM :-) c: "" for i 0 255 1 [ append c to-char i ] data: to-string array/initial 255 * 255 random c print length? data m: parse copy data "^/" print length? m print length? data i: parse copy data "^/" print length? i | |
Steeve 8-Feb-2010 [610] | did you calculate how many strings you build ? |
Sunanda 8-Feb-2010 [611x2] | I tried that code in R2 and R3.....R3 took about twice the memory. UNICODE strings plus unoptimised data structures may account for the difference. |
Worth noting too perhaps: after trying the test three times, unsetting 'c and 'm and recycling .... R3 got stuck trying to get into 'chat Possibly some screwed up garbage collection when recycling large elements? The failure is repeatable. | |
Henrik 8-Feb-2010 [613] | http://www.rebol.net/r3blogs/0307.html A bit of work to do for those interested. |
older newer | first last |