ASCII delimited files

Darrell news at dorb.com
Thu Nov 11 19:20:13 CET 1999


Oops.
That fix pushed into or beyond exponential runtime.
It won't finish the 3.6meg file anytime soon.
String slicing and pasting is dirt slow.

E:\ace\dtd\q\delim1>delimited.py
3600 bytes
0.0310000181198 time

E:\ace\dtd\q\delim1>delimited.py
36000 bytes
3.04700005054 time

Got some improvement with the attached version at
the cost of memory.

Now I'm thinking about the 'C' version again.

E:\ace\dtd\q\delim1>delimited.py
3600
0.0310000181198

E:\ace\dtd\q\delim1>delimited.py
36000
0.327999949455

E:\ace\dtd\q\delim1>delimited.py
360000
3.21899998188

E:\ace\dtd\q\delim1>delimited.py
3600000
48.2030000687

--
--Darrell


begin 666 delimited.py
M(R$@+W5S<B]B:6XO96YV('!Y=&AO;@T*(R!D96QI;6ET960N<'D-"B, at 36]D
M:69I960 at 9G)O;2!T:&4@;W)I9VEN86P at 8GD@1"=!<F-Y($HN32X at 0V%I;B \
M9&%R8WE 9')U:60N;F5T/@T*(PT*(R!#5#DY,#(R-B!6,"XQ#0H-"B(B(@T*
M8G)E86MI;F<@=&%B(&1E;&EM:71E9"!O<B!#4U8@=&5X="!I;G1O(&$@;&ES
M="!O9B!T=7!L97,N#0I/<FEG:6YA;"!V97)S:6]N.B!334, at 9&%T86)O;VL@
M<&QU9VEN+"!R96%D>&QS+G!Y#0I'96YE<F%L:7IE9"!T;R!B92!U<V%B;&4@
M9F]R(&%N>2!D96QI;6ET97(@8G5T(%QN+ at T*(B(B#0H-"FEM<&]R="!S=')I
M;F<-"@T*9&5F(&EN<V5R=$QI<W1$96QE=&4H:6YB=68L(&PI. at T*(" @("(B
M(B!);G-E<G0 at 86YD(&1E;&5T92!S96=M96YT<R!I;B!A(&)U9F9E<@T*(" @
M(&P@:7, at 82!L:7-T(&]F("AS=&%R="P@<V5Q3G5M+"!S=')I;F<L(&5N9"D@
M5&AE(&EN<'5T("=L)R!M=7-T(&)E('-O<G1E9 T*(" @($EF('-T87)T(&%N
M9"!E;F0 at 87)E(&5Q=6%L('1H96X@<W1R:6YG(&ES(&EN<V5R=&5D(&%T('1H
M870@<&]I;G0-"B @("!)9B!E;F0@/B!S=&%R="!T:&5N('1H:7,@<F%N9V4@
M:7, at 9&5L971E9"X-"B @("!)9B!E;F0@/"!S=&%R="!T:&5N('1H:7,@<F%N
M9V4@:7, at 9'5P;&EC871E9 T*#0H@(" @5&AE(&1E;&5T92!M;V1E(&ES(&YO
M="!W96QL('1E<W1E9"X-"B @("!7:&5N(&EN<V5R=&EN9R!W:&EC:"!C86X@
M8F4@=&AO=6=H(&]F(&%S(')E<&QA8V4@:7,@=&AE(&UO<W0 at 8V]M;6]N#0H@
M(" @=7-E+B!#=70 at 9G)O;2!S;VUE('-T87)T:6YG('!O:6YT(&EN(&)U9B!T
M;R!S;VUE(&5N9"!P;VEN="!A;F0-"B @("!I;G-E<G0@<V]M92!N97<@=&5X
M="X-"@T*(" @($%N(&]F9G-E="!I<R!M86EN=&%I;F5D(&-A;&QE9" B;&%S
M="(-"B @("!)9B!A;B!A='1E;7!T(&ES(&UA9&4@=&\@:6YS97)T(&%T(&$@
M<&]I;G0@;&]W97(@=&AA;B!L87-T#0H@(" @:70@:7,@:6=N;W)E9"X at 5&AI
M<R!I<R!T:&4 at 8V%S92!O9B!T=V\@<F5P;&%C97,@=V]R:VEN9R!O;@T*(" @
M('1H92!S86UE('!O:6YT+B!4:&4@<F5P;&%C92!W;W)K:6YG(&%T('1H92!L
M;W=E<W0@:6YD97@@=VEN<RX-"@T*(" @(%1H92!I;G!U="!W;W)K(&QI<W0@
M(FPB(&UU<W0 at 8F4@<V]R=&5D+ at T*(" @("(B(@T*(" @('-P;&ET0G5F/5M=
M#0H@(" @87!P96YD(#T@<W!L:71"=68N87!P96YD#0H@(" @;&%S=#TP#0H@
M(" @:68@;&5N*&PI/3TP. at T*(" @(" @("!R971U<FX@:6YB=68-"B @("!I
M9B!L96XH;%LP72D@/B S. at T*(" @(" @("!S=')/9F8], at T*(" @(" @("!E
M;F1/9F8],PT*(" @(&5L<V4Z#0H@(" @(" @('-T<D]F9CTQ#0H@(" @(" @
M(&5N9$]F9CTR#0H-"B @("!F;W(@:2!I;B!L. at T*(" @(" @("!N>'0]:5LP
M70T*(" @(" @("!B/6EN8G5F6VQA<W0Z;GAT70T*(" @(" @("!A<'!E;F0H
M8BD-"B @(" @(" @87!P96YD*&E;<W1R3V9F72D-"B @(" @(" @;&%S=#UI
M6V5N9$]F9ET@(" @(" @(R!!9'9A;F-E('!A<W0@<V]M92!B=69F97(@:&5R
M90T*(" @('-P;&ET0G5F+F%P<&5N9"AI;F)U9EML87-T.ETI#0H@(" @<F5T
M=7)N('-T<FEN9RYJ;VEN*'-P;&ET0G5F+"<G*0T*#0H-"@T*#0H-"@T*#0H-
M"@T*9&5F('-P;&ET7V1E;&EM:71E9"AS+"!D96QI;6ET97(]3F]N92D at .@T*
M(" @("(B(G-P;&ET(&$@9&5L:6UI=&5D('1E>'0 at 9FEL92!S=')I;F<@:6YT
M;R!A(&QI<W0@;V8@='5P;&5S+ at T*(" @(%%U;W1E<R!A<F4@;V)E>65D+"!E
M;F-L;W-E9"!N97=L:6YE<R!A<F4 at 97AP86YD960@=&\@=&%B+ T*(" @(&1O
M=6)L92!Q=6]T97, at 9V\@=&\@<75O=&5S(B(B#0H-"B @(" C(#DX,#0R-B!F
M:6YD:6YG(&QI;F4 at 9&5L:6UI=&5R(&1Y;F%M:6-A;&QY#0H-"B @("!P<F]B
M92 ]('-;.C$P,# P70T*(" @(&5O;" ](&9I;F1L:6YE9&5L:6UI=&5R*'!R
M;V)E*0T*#0H@(" @(R Y.3 R,C8 at 9W5E<W-I;F<@9FEE;&0 at 9&5L:6UI=&5R
M(&9R;VT@)UQT+"<@:68@;F]T('-U<'!L:65D#0H-"B @("!I9B!N;W0 at 9&5L
M:6UI=&5R. at T*(" @(" @("!C86YD:61A=&5S(#T at 6PT*(" @(" @(" @(" @
M*'-T<FEN9RYC;W5N="AP<F]B92P@)UQT)RDL("=<="<I+ T*(" @(" @(" @
M(" @*'-T<FEN9RYC;W5N="AP<F]B92P@)RPG*2P@)RPG*2P-"B @(" @(" @
M(" @(" @(" @(" @70T*(" @(" @("!C86YD:61A=&5S+G-O<G0H*0T*(" @
M(" @("!D96QI;6ET97(@/2!C86YD:61A=&5S6RTQ75LM,5T-"B @("!D96P@
M<')O8F4-"@T*(" @(",@=&AE('1R:6-K('1O(&UA:V4@=&AI<R!H86YD>2!I
M<R!T;R!U<V4 at 7# @87, at 82!P;&%C96AO;&1E<@T*#0H@(" @(R!+:6YD(&]F
M('5G;'D at 8G5T(&ET('=O<FMS(&9O<B!E;6)E9&1E9"!C;VUM87, at +2!$2DU#
M#0H@(" @:6YQ=6]T92 ](# -"B @("!W;W)K3&ES=#U;70T*(" @(&9O<B!I
M(&EN(')A;F=E*&QE;BAS*2DZ#0H@(" @(" @(&EF('-;:5T@/3T@)R(G.B!I
M;G%U;W1E(#T@*&EN<75O=&4@/3T@,"D-"B @(" @(" @:68@:6YQ=6]T92 ]
M/2 P(&%N9"!S6VE=(#T](&1E;&EM:71E<CH-"B,@(" @(" @(" @("!S(#T@
M<ULZ:5T@*R B7# B("L@<UMI("L@,3I=#0H@(" @(" @(" @("!W;W)K3&ES
M="YA<'!E;F0H*&DL,"PB7# B+&DI*0T*(" @(',](&EN<V5R=$QI<W1$96QE
M=&4H<RP@=V]R:TQI<W0I#0H-"B @("!P87)T<R ]('-T<FEN9RYS<&QI="AS
M+" G(B<I#0H@(" @;&EM:71S(#T@*# L(&QE;BAP87)T<RDM,2D-"B @("!F
M;W(@:2!I;B!R86YG92AL96XH<&%R=',I*2 Z#0H@(" @(" @(",@;6%Y(&%S
M('=E;&P@<W1R:7 @=&AE('-P86-E<R!N;W<@+2!$2DU##0H@(" @(" @('!A
M<G0@/2!S=')I;F<N<W1R:7 H<&%R='-;:5TI#0H@(" @(" @(&EF(&DE,B Z
M#0H@(" @(" @(" @("!P87)T(#T@<W1R:6YG+G)E<&QA8V4H<&%R="P at 96]L
M+"!D96QI;6ET97(I#0H@(" @(" @(&5L<V4 at .@T*(" @(" @(" @(" @:68@
M;F]T('!A<G0 at 86YD(&D@;F]T(&EN(&QI;6ET<SH@<&%R=" ]("<B)PT*(" @
M(" @("!P87)T<UMI72 ]('!A<G0-"B @(" C(&UE<F=E(&ET(&)A8VL-"B @
M("!T>'0@/2!S=')I;F<N:F]I;BAP87)T<RP@(B(I#0H@(" @<&%R=',@/2!S
M=')I;F<N<W!L:70H='AT+"!E;VPI#0H@(" @(R!N;W<@8G)E86L at 8GD@7# -
M"B @("!F;W(@:2!I;B!R86YG92AL96XH<&%R=',I*2 Z#0H@(" @(" @(&9I
M96QD<R ]('-T<FEN9RYS<&QI="AP87)T<UMI72P@(EPP(BD-"B @(" @(" @
M<&%R='-;:5T@/2!T=7!L92AF:65L9',I#0H@(" @<F5T=7)N('!A<G1S#0H-
M"B C('5T:6QI=&EE<PT*#0ID968 at 9FEN9&QI;F5D96QI;6ET97(H='AT*2 Z
M#0H@(" @(B(B#0H@(" @<')O=FED92!S;VUE(&MB(&]F('1E>'0@=&\@=&AI
M<R!F=6YC=&EO;BX at 270@=VEL;"!D971E<FUI;F4-"B @("!T:&4 at 8F5S="!D
M96QI;6ET97(@86YD('1H97)E9F]R92!G=65S<R!T:&4@<WES=&5M#0H@(" @
M(B(B#0H@(" @;6%C(" ](")<>#!$(@T*(" @('5N:7@@/2 B7'@P02(-"B @
M("!D;W,@(#T@;6%C*W5N:7 at -"B @("!O<V5S(#T at 6V1O<RP@=6YI>"P@;6%C
M70T*(" @(", at 9FEN9"!T:&4@;VYE('=H:6-H(&=I=F5S('1H92!M;W-T(&QI
M;F5S+ at T*(" @(",@:6X at 9&]U8G0L('1H92!L;VYG97-T(&1E;&EM:71E<B!W
M:6YS+ at T*(" @(&QI<R ](%M=#0H@(" @=VAI;&4@='AT(&%N9"!T>'1;+3%=
M(&EN(&1O<SH@='AT(#T@='AT6SHM,5T@(R!#5#DW,#DP- T*(" @(&9O<B!D
M96QI;2!I;B!O<V5S. at T*(" @(" @("!L:7,N87!P96YD*"AL96XH<W1R:6YG
M+G-P;&ET*'1X="P at 9&5L:6TI*2P at 9&5L:6TI*0T*(" @(&QI<RYS;W)T*"D[
M#0H@(" @<F5T=7)N(&QI<ULM,5U;+3%=#0H-"FEF(%]?;F%M95]?/3TB7U]M
M86EN7U\B. at T*(" @(&9O<B!L(&EN("!S<&QI=%]D96QI;6ET960H<B<G)S$L
M(#(L,RP@(G9I97(B+" B<75O(B)T92(L(")E;6)E9&1E9"P at 8V]M;6$B+" B
M=&AI<PT*(" @(&ES('=I=&@@82!N97=L:6YE(BP@:&5R90T*(" @(&%N;W1H
M97(@<F5C;W)D)R<G*3H-"B @(" @<')I;G0@;&5N*&PI#0H@(" @('!R:6YT
M(&P-"@T*#0H-"FEF(%]?;F%M95]?/3TB7U]M86EN7U\B. at T*#0H@(" @9'1A
M/2<G)S$L(#(L,RP@(G9I97(B+" B<75O(B)T92(L(")T:&ES#0II<R!W:71H
M(&$@;F5W;&EN92(L(&AE<F4-"F%N;W1H97(@<F5C;W)D)R<G*C4P,# P#0H@
M(" @:6UP;W)T('1I;64-"B @("!P<FEN="!L96XH9'1A*0T*(" @('0Q/71I
M;64N=&EM92 at I#0H@(" @<W!L:71?9&5L:6UI=&5D*&1T82D-"B @("!P<FEN
8="!T:6UE+G1I;64H*2UT,0T*#0H-"@T*
`
end





More information about the Python-list mailing list