<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 12 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
code
        {mso-style-priority:99;
        font-family:"Courier New";}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Vorformatiert Zchn";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
span.HTMLVorformatiertZchn
        {mso-style-name:"HTML Vorformatiert Zchn";
        mso-style-priority:99;
        mso-style-link:"HTML Vorformatiert";
        font-family:"Courier New";}
span.E-MailFormatvorlage21
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.E-MailFormatvorlage22
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.E-MailFormatvorlage23
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:616715157;
        mso-list-template-ids:2133215796;}
@list l0:level1
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:36.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l1
        {mso-list-id:927008607;
        mso-list-template-ids:-343229674;}
@list l1:level1
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:36.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l1:level2
        {mso-level-tab-stop:72.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level3
        {mso-level-tab-stop:108.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level4
        {mso-level-tab-stop:144.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level5
        {mso-level-tab-stop:180.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level6
        {mso-level-tab-stop:216.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level7
        {mso-level-tab-stop:252.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level8
        {mso-level-tab-stop:288.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level9
        {mso-level-tab-stop:324.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=DE link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='color:#1F497D'>As Thanksgiving is over, and as work towards 24-RDP1 should mostly be done, I think it is a good time to resume our now.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>To kick-off, below I am repeating my last response to Chen. Kindly asking everybody to chime in, so we can find a feasible and beneficial conclusion in this area.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>-Markus<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><a name="_MailEndCompose"><span style='color:#1F497D'><o:p> </o:p></span></a></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>Von:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> Markus Karg [mailto:markus@headcrashing.eu] <br><b>Gesendet:</b> Sonntag, 27. Oktober 2024 09:44<br><b>An:</b> 'core-libs-dev'<br><b>Betreff:</b> Request for Comments: Adding bulk-read method "CharSequence.getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin)"<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>>Hi Markus,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>>Should we drop the srcBigin/srcEnd parameters, as they can be replaced by a subSequence(srcBegin, srcEnd) call?<o:p></o:p></span></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'>Chen, I do understand your idea and while originally I had the same in mind (it really <i>is</i> appealing!), I came up with a draft using the <b>original</b> </span><span style='font-size:10.0pt;font-family:"Courier New"'>String.getChars()</span><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'> signature instead, due to the following drawbacks:<o:p></o:p></span></p><ul type=disc><li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l1 level1 lfo3'><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'>There might exist (possibly lotsof) </span><span style='font-size:10.0pt;font-family:"Courier New"'>CharSequence.getChars(int, int, char[], int)</span><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'> implementations already, as this problem (and the idea how to solve it) is anything but new. At least such implementations are </span><span style='font-size:10.0pt;font-family:"Courier New"'>String</span><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'>, </span><span style='font-size:10.0pt;font-family:"Courier New"'>StringBuilder</span><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'> and </span><span style='font-size:10.0pt;font-family:"Courier New"'>StringBuffer</span><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'>. If we come up with a different signature, then <b>none</b> of these already existing performance boosters will get used by </span><span style='font-size:10.0pt;font-family:"Courier New"'>Reader.of(CharSequence)</span><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'> automatically - at least until they come up with alias methods. Effectively this leads to (possibly lots) of alias methods. At least it leads to alias methods in </span><span style='font-size:10.0pt;font-family:"Courier New"'>String</span><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'>, </span><span style='font-size:10.0pt;font-family:"Courier New"'>StringBuilder</span><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'>, </span><span style='font-size:10.0pt;font-family:"Courier New"'>StringBuffer</span><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'> and </span><span style='font-size:10.0pt;font-family:"Courier New"'>CharBuffer</span><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'>. In contrast, when keeping the signature copied from </span><span style='font-size:10.0pt;font-family:"Courier New"'>String.getChars</span><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'>, chances are good that (possibly lots of) implementations will <i>instantly</i> be supported by </span><span style='font-size:10.0pt;font-family:"Courier New"'>Reader.of(CharSequence)</span><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'> without alias methods. At least, </span><span style='font-size:10.0pt;font-family:"Courier New"'>String</span><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'>, </span><span style='font-size:10.0pt;font-family:"Courier New"'>StringBuilder</span><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'> and </span><span style='font-size:10.0pt;font-family:"Courier New"'>StringBuffer</span><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'> will be.<o:p></o:p></span></li><li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l1 level1 lfo3'><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'>Since decades people are now very used to </span><span style='font-size:10.0pt;font-family:"Courier New"'>StringBuilder.getChars(int, int, char[], int)</span><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'>, so (possibly a lot of) people might simply <i>expect</i> us to come up with that lengthy signature. These people might be rather confused (if not to say frustrated) when we now force them to write an intermediate </span><span style='font-size:10.0pt;font-family:"Courier New"'>subSequence(int, int)</span><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'> for something that was "such simple" before.<o:p></o:p></span></li><li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l1 level1 lfo3'><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'>Custom implementations of </span><span style='font-size:10.0pt;font-family:"Courier New"'>CharSequence.subSequence</span><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'> could come up with the (performance-wise "bad") idea of creating <b>copies</b> instead of views. At least it seems like </span><span style='font-size:10.0pt;font-family:"Courier New"'>AbstractStringBuilder</span><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'> is doing that, so chances are "good" that custom libs will do that, too. For example, because they need it for safety. Or possibly, because they have a technical reason that <i>enforces</i> a copy. That would (possibly massively, depending on the actual class) spoil the idea of performance-boosting this RFC is all about.<o:p></o:p></span></li></ul><p class=MsoNormal><span style='color:#1F497D'>-Markus<o:p></o:p></span></p></div></body></html>