World: r3wp
[!REBOL3]
older newer | first last |
Pekr 8-Feb-2010 [545] | Ah, special mode parsing ... you try to get block of lines, correct? I wonder if using some parse rules instead would show so much of a difference between R2 and R3? |
sqlab 8-Feb-2010 [546x2] | split produces the expected behaviour bit , but is still 10x slowlier. |
c: "" for i 0 255 1 [ append c to-char i ] data: to-string array/initial 255 * 255 random c m: parse data "^/" l: length? m I get always diferent values for l. | |
Ashley 8-Feb-2010 [548] | >> trim/with #{001100} #{00} == #{11} >> trim/head/with #{001100} #{00} ** Script error: incompatible or invalid refinements ** Where: trim ** Near: trim/head/with #{001100} #{00} |
Pekr 8-Feb-2010 [549] | sqlab - 'split is a mezzanine, hence slower imo ... |
sqlab 8-Feb-2010 [550] | Is that behaviour somewhere documented, that this "special mode parsing" does not work anymore? |
Graham 8-Feb-2010 [551] | >> dt [ loop 1000000 [ parse "abc def" none ]] == 0:00:01.842453 >> t1: now/precise loop 1000000 [ parse "abc def" none ] t2: now/precise == 8-Feb-2010/23:00:21.43+13:00 >> difference t1 t2 == -0:00:01.004 >> |
Pekr 8-Feb-2010 [552] | sqlab - I did not say it should not work, it should work. But there might be some bug or something like that, because parse was highly modified ... |
sqlab 8-Feb-2010 [553] | G: Dont parse some chars many times, parse many chars a few times. |
Graham 8-Feb-2010 [554] | 0 < 2 < 100 ... so still in the range |
sqlab 8-Feb-2010 [555] | Especially look at the outcome of the parsing, even with the same data I get alyways different results |
Pekr 8-Feb-2010 [556] | Graham - I don't understand your test at all :-) |
sqlab 8-Feb-2010 [557] | just try my example |
Graham 8-Feb-2010 [558] | different results .. you're using 'random |
Pekr 8-Feb-2010 [559x2] | let's try to compare following for R2 vs R3: parse "abc^/def^/ghi^/" [start: any [end: newline (print copy/part start end) start: | skip]] |
well, just remove (print ...) ... I just want to find out the traversal time .... | |
Graham 8-Feb-2010 [561] | I normally just parse short bits of text .. so R2 looks to be 2x faster than R3 |
Pekr 8-Feb-2010 [562x3] | s: now/time/precise loop 1000000 [parse "abc^/def^/ghi^/" [start: any [end: newline start: | skip]]] now/time/precise - s Three consecutive runs: R2: 0:00:03.11 0:00:02.941 0:00:03.089 R3: 0:00:01.732 0:00:01.679 0:00:01.724 |
the above code does not run in R3. Dunno if "end" is forbidden or became a keyword, but I get following error, if I don't change end: to en: >> s: now/time/precise loop 1000000 [parse "abc^/def^/ghi^/" [start: any [end: n ewline start: | skip]]] now/time/precise - s ** Script error: PARSE - command cannot be used as variable: end: ** Where: parse loop ** Near: parse {abc def ghi } [start: any [end: newline start: | skip... | |
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 ... |
older newer | first last |