Re: G_UTF8String: Boxed Type Proposal

On Fri, Mar 18, 2016 at 9:57 AM, Randall Sawyer
<srandallsawyer hushmail me> wrote:

2) If the former is true - which it is - then the developer will need to
call g_utf8_strlen() to determine if there are multi-byte sequences to
navigate - and if there are - g_utf8_offset_to_pointer() to locate the array
index. Doesn't this increase processing demand?

It does. But whether that is a problem (in general, or for your
particular use case) can only be answered by  profiling. My theory is
that you won't be able to notice this on the profile at all, unless
all your application does is constantly operating on large amounts of
text. In which case, you really shouldn't be using GString to begin

3) Wouldn't it be helpful to keep track of how many code points
("characters")are stored in the GString - a number which may be less than
the value of GString.len - without needing to call g_utf8_strlen() each time
to find out?
4) Would my efforts be better spent editing patches of "gstring.h" and
"gstring.c" - or - to proceed as I am to introduce a parallel alternative?

I think we haven't gotten past the 'what is the problem you are trying
to solve - and is it a problem in the first place ?' part yet.

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]