September 02, 2004 Re: performance of char vs wchar | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | "Walter" <newshound@digitalmars.com> wrote in message news:ch048q$2uql$1@digitaldaemon.com... > > "Berin Loritsch" <bloritsch@d-haven.org> wrote in message news:cgv92r$2fvv$1@digitaldaemon.com... > > Umm, what about the toString() function? Doesn't that assume char[]? Hense, it is the default by example. > > Yes, but it isn't char(!)acteristic of D. > > > I'll be honest, I don't get why optimization is so important when there hasn't been determined a need yet. > > Efficiency, or at least potential efficiency, has always been a strong attraction that programmers have to C/C++. Since D is targetted at that market, efficiency will be a major consideration. If D acquires an early reputation for being "slow", like Java did, that reputation can be very, very hard to shake. > > > I am sure there can be quicker ways > > of dealing with allocation and de-allocation--this would make the system > > faster for all objects, not just strings. If that can be done, why not > > concentrate on that? > > There's no way to just wipe away the costs of using double the storage. But this claim holds true only for those who have English as their only working language, and (maybe) for a few others in Europe. In all other markets (5 billion+) the utf8 storage will in fact (mostly) be _larger_ than the utf16 storage. And as I proposed earlier, you could leave an otption for English/Europeans in the form of char defined as in C/C++, which would in addition to being just as fast, actually make the transition to the D language easier. I think it all comes down to this: will D became a general purpose language for the international community or will it mostly become a "better" C++ for English speakers only? Roald |
Copyright © 1999-2021 by the D Language Foundation