[Include] y_stringhash - Fast string comparisons.
#5

****** is right but I don't understand the purpose of comparing a lot of strings with this way
PHP код:
main()
{
    new 
count,
        
MAX_LOOP 100000,
        
something;
    print(
"Starting...");
    
count GetTickCount();
    for(new 
iMAX_LOOPi++)
    {
        switch(
YHash("Arrestation"))
        {
            case 
_H<Entreprise> : print("Oki");
            case 
_H<Restaurent> : print("Oki");
            case 
_H<Bar> : print("Oki");
            case 
_H<Vehicule> : print("Oki");
            case 
_H<Bar1> : print("Oki");
            case 
_H<Vehicule1> : print("Oki");
            case 
_H<Bar2> : print("Oki");
            case 
_H<Vehicule2> : print("Oki");
            case 
_H<Bar3> : print("Oki");
            case 
_H<Vehicule3> : print("Oki");
            case 
_H<Bar4> : print("Oki");
            case 
_H<Vehicule4> : print("Oki");
            case 
_H<Bar5> : print("Oki");
            case 
_H<Vehicule5> : print("Oki");
            case 
_H<Arrestation> : something++;
        }
    }
    
count GetTickCount() - count;
    
printf("[1] Finished in %ims"count);
    
count GetTickCount();
    for(new 
iMAX_LOOPi++)
    {
        if(!
strcmp("some_type""Entreprise"))
            print(
"Oki");
        else if(!
strcmp("some_type""Restaurent"))
            print(
"Oki");
        else if(!
strcmp("some_type""Bar"))
            print(
"Oki");
        else if(!
strcmp("some_type""Vehicule"))
            print(
"Oki");
        else if(!
strcmp("some_type""Bar"))
            print(
"Oki");
        else if(!
strcmp("some_type""Vehicule"))
            print(
"Oki");
        else if(!
strcmp("some_type""Bar"))
            print(
"Oki");
        else if(!
strcmp("some_type""Vehicule"))
            print(
"Oki");
        else if(!
strcmp("some_type""Bar"))
            print(
"Oki");
        else if(!
strcmp("some_type""Vehicule"))
            print(
"Oki");
        else if(!
strcmp("some_type""Bar"))
            print(
"Oki");
        else if(!
strcmp("some_type""Vehicule"))
            print(
"Oki");
        else if(!
strcmp("Arrestation""Arrestation"))
            
something++;
    }
    
count GetTickCount() - count;
    
printf("[2] Finished in %ims"count);

Код:
[21:00:16] [1] Finished in 65ms
[21:00:16] [2] Finished in 71ms
Reply


Messages In This Thread
y_stringhash - Fast string comparisons. - by corne - 17.04.2015, 19:17
Re: y_stringhash - Fast string comparisons. - by Kaperstone - 12.07.2017, 22:21
Re: y_stringhash - Fast string comparisons. - by Meller - 12.07.2017, 22:29
Re: y_stringhash - Fast string comparisons. - by xMoBi - 13.07.2017, 09:36
Re: y_stringhash - Fast string comparisons. - by Dayrion - 15.07.2017, 19:06
Re: y_stringhash - Fast string comparisons. - by PT - 15.07.2017, 22:54
Re: y_stringhash - Fast string comparisons. - by Astralis - 15.07.2017, 23:14
Re: y_stringhash - Fast string comparisons. - by Riddick94 - 16.07.2017, 15:43
Re: y_stringhash - Fast string comparisons. - by Kaperstone - 16.07.2017, 16:06
Re: y_stringhash - Fast string comparisons. - by Y_Less - 16.07.2017, 18:47
Re: y_stringhash - Fast string comparisons. - by Riddick94 - 18.07.2017, 18:06

Forum Jump:


Users browsing this thread: 4 Guest(s)