- What is the best encoding (experiences...) for unicode? - 3 Updates
- C++ or Object Pascal - 2 Updates
- cmsg cancel <mclke4$7qj$1@dont-email.me> - 2 Updates
Juha Nieminen <nospam@thanks.invalid>: Feb 26 08:11AM > is only 1.5 times difference of storage. Things run typically > sufficiently fast so I can rarely convince shareholders of maintenance > that supposedly improves performance by less than 2 times. If the tight inner loop of your dictionary search consists of character comparisons, and you are performing millions of such comparisons (as is very easily the case with eg. puzzle solvers), UTF-16/UCS-2 vs. UTF-8 makes a significant difference. It also makes the code simpler and shorter. --- news://freenews.netfront.net/ - complaints: news@netfront.net --- |
JiiPee <no@notvalid.com>: Feb 26 08:34AM On 24/02/2015 08:39, Juha Nieminen wrote: > UTF-8 would be horrible in terms of speed for this, while UTF-16 > would be quite optimal. > --- news://freenews.netfront.net/ - complaints: news@netfront.net --- both are variable byte strings. You mean its faster because it contains less bytes on average than UTF-8? Thats why its faster? Or because the encoding rules are faster? |
Martijn Lievaart <m@rtij.nl.invlalid>: Feb 26 10:56AM +0100 On Thu, 26 Feb 2015 08:34:19 +0000, JiiPee wrote: > both are variable byte strings. You mean its faster because it contains > less bytes on average than UTF-8? Thats why its faster? Or because the > encoding rules are faster? Assuming he ment UCS2 where he said UTF-16, I would guess because indexing is faster. In applications like the puzzle solver above, that would be the bottleneck. M4 |
Ben Bacarisse <ben.usenet@bsb.me.uk>: Feb 25 10:40PM Ramine <ramine@1.1> writes: <snip> > for (i = 0; i < 7; i++) > So as you have noticed there is an "i++" that we must add in C and > C++, so Object Pascal is more beautiful and easier here... What does this loop look like in Object Pascal: for (auto i : { 2, 3, 5, 7, 11, 13, 17 }) f(i); In C++, if you decide you need to generate these numbers and do other calculation on the collection you can write for (auto i : some_primes) f(i); with some_primes declared in all sort of ways depending on what you need to do with them: std::set<int> some_primes = { 2, 3, 5, 7, 11, 13, 17 }; std::vector<int> some_primes = { 2, 3, 5, 7, 11, 13, 17 }; std::list<int> some_primes = { 2, 3, 5, 7, 11, 13, 17 }; int some_primes[] = { 2, 3, 5, 7, 11, 13, 17 }; without any change to the loop. <snip> -- Ben. |
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Feb 26 01:02AM On 26/02/2015 02:05, Ramine wrote: > noticed the Object Pascal of the Delphi and FreePascal are powerful, > they can support generics, and they even support also Lambda expressions > to express more your program in a functional manner ... You didn't answer his question. Again: what do those C++ loops look like in Object Pascal? I bet the answer isn't pretty mate. /Flibble |
bleachbot <bleachbot@httrack.com>: Feb 26 12:05AM +0100 |
bleachbot <bleachbot@httrack.com>: Feb 26 12:34AM +0100 |
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page. To unsubscribe from this group and stop receiving emails from it send an email to comp.lang.c+++unsubscribe@googlegroups.com. |