Re: [TCLCORE] [SPAM] [6.0] Re: base64 in the core?
by Donal K. Fellows other posts by this author
Apr 27 2008 4:07PM messages near this date
Re: [TCLCORE] [SPAM] [6.0] Re: base64 in the core?
|
Re: [TCLCORE] [SPAM] [6.0] Re: base64 in the core?
Larry McVoy wrote:
> If you don't return but one char at a time, isn't it cheaper?
Maybe. I'd be interested in seeing real measurements. (I only know what
I did to [split] was a win because I measured it.)
> Shouldn't that just maintain a reference on buf throughout the loop (so
> noone can change it) and internally, in the state for the foreach,
> maintain an index into buf? Module unicode char widths, etc.
>
> It seems to me that is mucho cheaper than internally splitting it into
> a bunch of char objects. Just use one. Would that not work?
Theoretically yes, but you're spreading a lot of complexity to handle
these indexed (and reference-counted) strings properly. Such things can
be a source of tremendous problems[*], and a key lesson of Tcl to me has
been that doing something simpler is often more than good enough. But
does that apply here? I dunno. Needs an experiment. :-)
Donal.
[* For example, Java strings are fairly slow and they do this sort of
trick extensively under the covers. I've seen even more stark
evidence in research languages which only succeeded in persuading me
that Tcl really is good at this! ]
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Tcl-Core mailing list
Tcl-Core@[...].net
https://lists.sourceforge.net/lists/listinfo/tcl-core
Thread:
Trevor Davel
Pat Thoyts
Kevin Kenny
Donal K. Fellows
Larry McVoy
Donal K. Fellows
Larry McVoy
Donal K. Fellows
Kevin Kenny
Donal K. Fellows
Larry McVoy
Donal K. Fellows
Alexandre Ferrieux
Lars Hellstrom
Donal K. Fellows
Alexandre Ferrieux
Donal K. Fellows
Alexandre Ferrieux
Donal K. Fellows
Alexandre Ferrieux
Larry McVoy
|