-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Am 06.12.2010 20:53, schrieb Lin Rongrong: > Seems nobody cares about --std-c99 and _Bool speed before,
Well, I do, and _Bool does get better. Naturally I use my own code for test cases, so if your coding style is different from mine, it's likely, that there's untapped potential for optimization when compiling your code. That's true even for things other than _Bool. > Aso I made a test > my self, using the following function: > > BOOLEAN TestBoolean(BOOLEAN b1) > { > USHORT s; > BOOLEAN b2; > BOOLEAN b3; > > b3 = IsHighSpeed(); > for (s = 0; s < 30000; s ++) > { > b2 = b1 ? b3 : FALSE; > } > return b2; > } > > When BOOLEAN as unsigned char, the running time of this function on my Z80 > is 137ms, and code generated is less by 4 bytes. > When BOOLEAN as _Bool, using bit related instructions, this function need > 167ms to run. > > Woody Well, _Bool is still much younger, so not all potential for optimization has been used yet. On the other hand, unsigned char has been around for a very long time. The ternary operator ?: was not that good for _Bool, resulting in an unecessary cast. I just fixed it (rev #6078). From now on your example TestBoolean() should be faster when using _Bool compared to unsigned char. Philipp -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkz9U04ACgkQbtUV+xsoLpqtuACgoYlylnNUIDShTcKuWa7eO1Ei 5FUAoNwdd8AlPVPqvfgAT3tKdc9HhOn1 =JPer -----END PGP SIGNATURE----- ------------------------------------------------------------------------------ What happens now with your Lotus Notes apps - do you make another costly upgrade, or settle for being marooned without product support? Time to move off Lotus Notes and onto the cloud with Force.com, apps are easier to build, use, and manage than apps on traditional platforms. Sign up for the Lotus Notes Migration Kit to learn more. http://p.sf.net/sfu/salesforce-d2d _______________________________________________ Sdcc-user mailing list Sdcc-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sdcc-user