Re: ClassReader.readUtf and compact strings
Eirik Bjørsnøs (via asm Mailing List) <[email protected]> Sat, 6 Feb 2021 12:00:02 +0100
| Newsgroups | gmane.comp.java.objectweb.asm |
|---|---|
| Message-ID | <CA+pBWhuMAg4sTRft2gtSB1+827o=5A65NYe1K5S7UawKsGcchQ@mail.gmail.com> |
This is a multi-part message in MIME format... ------------=_1612609216-15976-8 Content-Type: multipart/alternative; boundary="00000000000046da6c05baa8d74d" --00000000000046da6c05baa8d74d Content-Type: text/plain; charset="UTF-8" > > Thanks for your experiments! The String constructor using a Charset is > only available in JDK 1.6, and we maintain 1.5 compatibility currently, > so we can't use it. > Well, such is life :-) Another note: While profiling ASM, it did occur to me that a lot of the time is spent around UTF/string parsing. Not all instrumentation needs access to these strings, or only rarely needs them. So it made me wonder what an API would look like which maybe only passed the constant pool indexes around and let visitors decode strings only when needed. The API changes required to do this probably moves the idea into fantasy land, but I imagine it could be a big performance win for some cases. Cheers, Eirik. --00000000000046da6c05baa8d74d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div class=3D"gmail_quote"><blockquote class=3D"gmail_quot= e" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204)= ;padding-left:1ex">Thanks for your experiments! The String constructor usin= g a Charset is <br> only available in JDK 1.6, and we maintain 1.5 compatibility currently, <br> so we can't use it.<br></blockquote><div><br></div><div>Well, such is l= ife :-)</div><div><br></div><div>Another note: While profiling ASM, it did = occur to me that a lot of the time is spent around UTF/string parsing. Not = all instrumentation needs access=C2=A0to these strings, or only rarely need= s them.=C2=A0</div><div><br></div><div>So it made me wonder what an API wou= ld look like which maybe only passed the constant pool indexes around and l= et visitors=C2=A0decode strings only when needed.=C2=A0</div><div><br></div= ><div>The API changes required to do this probably moves the idea into fant= asy=C2=A0land, but I imagine it could be a big performance win for some cas= es.</div><div><br></div><div>Cheers,</div><div>Eirik.</div></div></div> --00000000000046da6c05baa8d74d-- ------------=_1612609216-15976-8 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit -- You receive this message as a subscriber of the [email protected] mailing list. To unsubscribe: mailto:[email protected] For general help: mailto:[email protected]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws ------------=_1612609216-15976-8--