Is there any difference between byte(a) and a in performance?

196 views
Skip to first unread message

гусь

unread,
May 23, 2019, 12:24:56 PM5/23/19
to golang-nuts
a = 'a'
fmt.Println(a)

fmt.Println(byte(a))

Jan Mercl

unread,
May 23, 2019, 12:34:04 PM5/23/19
to гусь, golang-nuts
There will be a difference - once someone optimizes the 256 possible decadic representations of a byte as an array of hardcoded strings in the fmt package ;-)

On Thu, May 23, 2019, 18:25 гусь <endem...@gmail.com> wrote:
a = 'a'
fmt.Println(a)

fmt.Println(byte(a))

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/1b9af632-7dc3-482a-bad9-49a1a4fa6065%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages