Discussion:
strings.Split optimizations
r
2013-11-06 08:16:53 UTC
Permalink
It appears that string.Split (which calls genSplit) does the job in
two-passes, and does allocate.
I believe this behavior can be optimizes.

Especially when len(sep) is 1.
--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
minux
2013-11-06 21:26:53 UTC
Permalink
Post by r
It appears that string.Split (which calls genSplit) does the job in
two-passes, and does allocate.
I believe this behavior can be optimizes.
Please file an issue and detail what kind of optimization you think is
necessary.
Thank you.
Post by r
Especially when len(sep) is 1.
--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
r
2013-11-07 01:18:27 UTC
Permalink
Sorry, I just realized that I made a mistake. There's no avoiding
allocating, and if we try to do it in a single pass, we have to use append
or make unnecessarily large allocation.
Post by minux
Post by r
It appears that string.Split (which calls genSplit) does the job in
two-passes, and does allocate.
I believe this behavior can be optimizes.
Please file an issue and detail what kind of optimization you think is
necessary.
Thank you.
Post by r
Especially when len(sep) is 1.
--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
Loading...