Changeset 151 for trunk


Ignore:
Timestamp:
May 22, 2008, 2:42:11 PM (11 years ago)
Author:
lindanl
Message:

Performance test definitions.

Location:
trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/byteplex.c

    r111 r151  
    219219int Byteplex::CopyAndFill(unsigned char * bytes_to_copy, int lgth, int bytes_to_read) {
    220220        memcpy(src_buffer, bytes_to_copy, lgth);
     221#if defined(PAPI) and defined(CODE_CLOCKING) and (CODE_CLOCKING == FILE_READING)
     222        code_clocker->cc_start_interval();
     223#endif
    221224        int bytes_read = fread(&((unsigned char *)src_buffer)[lgth], 1, bytes_to_read, infile);
     225#if defined(PAPI) and defined(CODE_CLOCKING) and (CODE_CLOCKING == FILE_READING)
     226        code_clocker->cc_end_interval(bytes_read);
     227#endif
    222228        return bytes_read;
    223229}
  • trunk/src/engine.c

    r147 r151  
    640640//      int lgth = AbsPos()-name_start;
    641641
     642#if (not defined(OMISSION)) or ((OMISSION != END_TAG_MATCHING)  and (OMISSION != NAME_LOOKUP))
    642643        char * start_elem_name = model_info->symbol_table->Get_UTF8_name(nameID);
    643644        int lgth = model_info->symbol_table->Get_UTF8_lgth(nameID);
     
    673674            }
    674675        }
    675 //     
     676#endif
     677#if defined(OMISSION) and ((OMISSION == END_TAG_MATCHING) or (OMISSION == NAME_LOOKUP))
     678        ScanTo(NameFollow);
     679#endif
    676680//      for(int i=0; i<lgth; i++) {
    677681//              if (start_elem_name[i] != end_elem_name[i])
     
    727731                        int att_nameID = Parse_Name();
    728732                        att_name_end = AbsPos();
    729                
     733                #if (not defined(OMISSION)) or ((OMISSION != ATTRIBUTE_UNIQUENESS) and (OMISSION != NAME_LOOKUP))
    730734                        int attID = model_info->getOrInsertGlobalAttName(att_nameID);
    731735                        if (attID >= LastAttOccurrence.size()) LastAttOccurrence.push_back(0);
     
    737741                        }
    738742                        LastAttOccurrence[attID] = att_name_start;
     743                 #endif
    739744                        /* The following optimized tests handle the frequently occurring
    740745                        case that there are no blanks on either side of the equals sign.
     
    814819        }
    815820}
    816 
    817821
    818822template <CodeUnit_Base C>
     
    18821886                        att_name_start = AbsPos();
    18831887                        int att_nameID = Parse_Name();
    1884                
     1888                        #if (not defined(OMISSION)) or (OMISSION != ATTRIBUTE_UNIQUENESS)
    18851889                        int attID = model_info->getOrInsertGlobalAttName(att_nameID);
    18861890                        if (attID >= LastAttOccurrence.size()) LastAttOccurrence.push_back(0);
     
    18921896                        }
    18931897                        LastAttOccurrence[attID] = att_name_start;
     1898                        #endif
    18941899                        /* The following optimized tests handle the frequently occurring
    18951900                        case that there are no blanks on either side of the equals sign.
     
    21572162        int name_pos = AbsPos();
    21582163        ScanTo(NameFollow);
     2164        #if (not defined(OMISSION)) or (OMISSION != NAME_LOOKUP)
    21592165        int lgth = AbsPos()-name_pos;
     2166
    21602167        if (entity_Info->version == XML_1_1){
    21612168                return model_info->symbol_table->UTF8_Lookup_or_Insert_XML11_Name((char *)GetCodeUnitPtr(name_pos),lgth);
     
    21632170        else
    21642171                return model_info->symbol_table->UTF8_Lookup_or_Insert_XML10_Name((char *)GetCodeUnitPtr(name_pos),lgth);
     2172        #endif
    21652173}
    21662174
     
    21682176template <CodeUnit_Base C>
    21692177inline void ParsingEngine<C>::Parse_DocumentContent() {
    2170 #ifdef VALIDATION
    2171         printf("Validation Mode On!\n");
     2178#if (VALIDATION_MODE == ON)
    21722179        int final_state = Parse_ValidContent(model_info->rootModel);
    21732180        if (model_info->rootModel->transition_map[final_state][0]==0) {
     
    21752182        }
    21762183#endif
    2177 #ifndef VALIDATION     
     2184#if (VALIDATION_MODE == OFF)   
    21782185        Parse_WF_Element();
    21792186        ScanTo(NonWS);
  • trunk/src/symtab.c

    r141 r151  
    208208        name[lgth] = delim;     
    209209        if (nameID == 0){
     210        #if (not defined(OMISSION)) or (OMISSION != NAME_VALIDATION)
    210211                if (!is_XML10_UTF8_Name(name,lgth)) {
    211212                        ShowSyntaxError(NT_Name);
    212213                        exit(-1);
    213214                }
     215        #endif
    214216                char * s = copy_name(name,lgth);
    215217                UTF8NameMap[s]=++(globalNameCount);
     
    228230        int nameID = UTF8NameMap[s];
    229231        if(nameID == 0){
     232        #if (not defined(OMISSION)) or (OMISSION != NAME_VALIDATION)
    230233                if (!is_XML11_UTF8_Name(name,lgth))  {
    231234                        ShowSyntaxError(NT_Name);
    232235                        exit(-1);
    233236                }
     237        #endif
    234238                UTF8NameMap[s]=++(globalNameCount);
    235239                nameID = globalNameCount;
Note: See TracChangeset for help on using the changeset viewer.