[svn:parrot] r46231 - trunk/compilers/imcc
chromatic at svn.parrot.org
chromatic at svn.parrot.org
Mon May 3 08:57:06 UTC 2010
Author: chromatic
Date: Mon May 3 08:57:06 2010
New Revision: 46231
URL: https://trac.parrot.org/parrot/changeset/46231
Log:
[IMCC] Rearranged the STRING comparisons in add_const_str() to find mismatches
before performing almost useless comparisons. This speeds up building an
example NQP-based PBC by 27.777%.
Modified:
trunk/compilers/imcc/pbc.c
Modified: trunk/compilers/imcc/pbc.c
==============================================================================
--- trunk/compilers/imcc/pbc.c Mon May 3 07:55:30 2010 (r46230)
+++ trunk/compilers/imcc/pbc.c Mon May 3 08:57:06 2010 (r46231)
@@ -990,11 +990,12 @@
PackFile_Constant * const constant = table->constants[i];
if (constant->type == PFC_STRING) {
STRING * const sc = constant->u.string;
- if (Parrot_charset_number_of_str(interp, s)
+ if (Parrot_str_equal(interp, s, sc)
+ && Parrot_charset_number_of_str(interp, s)
== Parrot_charset_number_of_str(interp, sc)
&& Parrot_encoding_number_of_str(interp, s)
== Parrot_encoding_number_of_str(interp, sc)
- && Parrot_str_equal(interp, s, sc)) {
+ ) {
return i;
}
}
More information about the parrot-commits
mailing list