- What is the best encoding (experiences...) for unicode? - 3 Updates
- C++ or Object Pascal - 2 Updates
- cmsg cancel <mclm5d$dkh$1@dont-email.me> - 1 Update
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 |
Ramine <ramine@1.1>: Feb 25 06:34PM -0800 On 2/25/2015 2:40 PM, Ben Bacarisse wrote: > int some_primes[] = { 2, 3, 5, 7, 11, 13, 17 }; > without any change to the loop. > <snip> Sorry for my english, i will correct some typos, please read again... Hello Ben Becarisse, Generics are supported by Object Pascal of Delphi and FreePascal compilers, and what you are doing above with C++ is creating objects of classes that support generics, so you are passing <int>, that means you are creating objects that has there elements of type "int"... generics are also supported by Object Pascal of Delphi and FreePascal compilers, so what you can do with Delphi and FreePascal is create objects of datastructures that support generics, in Delphi and FreePascal we have for example the TList datastructure that supports generics.. So we create an Object of TList datastructure using generics as follow in Object Pascal of the Delphi and FreePascal compilers: var Item: Integer; [1] List: TList<Integer>; .... [2] for Item in List do Writeln(Item); As in C++, in the Object Pascal code above, notice that in [1] we are creating an object of class Tlist that supports generics, and in [2], like in C++, we are using the "for" loop to go through the elements of the Tlist, this will work with the Object Pascal of the Delphi and FreePascal compilers.. and you can easily find libraries of Object Pascal in internet that support classes that support generics and you can do the same as you are doing with C++...so as you have 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 ... Thank you, Amine Moulay Ramdane. |
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: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. |
No comments:
Post a Comment