[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: String tokenization function
- From: Matthew Wild <mwild1@...>
- Date: Sat, 7 Nov 2015 22:23:44 +0000
On 7 November 2015 at 15:52, Marco Atzori <firstname.lastname@example.org> wrote:
> Il 07/11/2015 16:46, Matthew Wild ha scritto:
>> If you have actual constraints, revealing them might allow people to
>> help you better. If you don't have any constraints and just want it to
>> perform well, then there are some really much simpler and more
>> efficient solutions than your implementation.
> This code is part of a videogames addon, and is executed every frame refresh
> (about every tenth of a second) for which using tables created in
> continuation is a considerable waste of memory. If there are simpler
> solutions, show them to me as well. I asked your help for this reason ;-)
I have another question: is your API so flexible because it needs to
be? The 'range' option, especially the possibility of it and/or the
start position being negative, is responsible for a lot of the
function's complexity and performance too.
If you are just using this function for one specific thing on each
frame refresh, you could probably get big performance improvements by
making it less generic.