PDA

Просмотр полной версии : [Вопрос] Загрузка домов из БД(ms)



underwoker
24.04.2014, 19:04
Доброго времени суток!
Появился у меня интерес к загрузке домов, точнее к милисекундам.
Начал недавно перевод мода, и уже почти все готово, но 6 домов грузятся за 130ms, это нормально? За такое время на файлах 700 домов грузилось. Причем с каждым домом добавленным, время прибавляется на 20-30мс.
Вот загрузка домов, что в ней не так?


publics: LoadHouses() //
{
new time = GetTickCount();
new rows,fields;
cache_get_data(rows,fields);
//new vresult[32];
if(rows)
{
for(new idx = 1; idx <= rows; idx++)
{
HomeInfo[idx][hID] = cache_get_field_content_int(idx-1,"hID",base);
HomeInfo[idx][hOwned] = cache_get_field_content_int(idx-1,"hOwned",base);
cache_get_field_content(idx-1,"hOwner",HomeInfo[idx][hOwner],base,32);
HomeInfo[idx][hEntrance][0] = cache_get_field_content_float(idx-1,"hEntrancex",base);
HomeInfo[idx][hEntrance][1] = cache_get_field_content_float(idx-1,"hEntrancey",base);
HomeInfo[idx][hEntrance][2] = cache_get_field_content_float(idx-1,"hEntrancez",base);
HomeInfo[idx][hExit][0] = cache_get_field_content_float(idx-1,"hExitx",base);
HomeInfo[idx][hExit][1] = cache_get_field_content_float(idx-1,"hExity",base);
HomeInfo[idx][hExit][2] = cache_get_field_content_float(idx-1,"hExitz",base);
HomeInfo[idx][hValue] = cache_get_field_content_int(idx-1,"hValue",base);
HomeInfo[idx][hHel] = cache_get_field_content_int(idx-1,"hHel",base);
HomeInfo[idx][hInt] = cache_get_field_content_int(idx-1,"hInt",base);
HomeInfo[idx][hLock] = cache_get_field_content_int(idx-1,"hLock",base);
HomeInfo[idx][hOgrablen] = cache_get_field_content_int(idx-1,"hOgrab",base);
HomeInfo[idx][hCar] = cache_get_field_content_int(idx-1,"hCar",base);
HomeInfo[idx][hTakings] = cache_get_field_content_int(idx-1,"hTakings",base);
HomeInfo[idx][hNarko] = cache_get_field_content_int(idx-1,"hNarko",base);
HomeInfo[idx][hOnline] = cache_get_field_content_int(idx-1,"hOnline",base);
HomeInfo[idx][hKlass] = cache_get_field_content_int(idx-1,"hKlass",base);
HomeInfo[idx][hCarPoc][0] = cache_get_field_content_float(idx-1,"hCarx",base);
HomeInfo[idx][hCarPoc][1] = cache_get_field_content_float(idx-1,"hCary",base);
HomeInfo[idx][hCarPoc][2] = cache_get_field_content_float(idx-1,"hCarz",base);
HomeInfo[idx][hCarPoc][3] = cache_get_field_content_float(idx-1,"hCarc",base);
HomeInfo[idx][hSafe] = cache_get_field_content_int(idx-1,"hSafe",base);
HomeInfo[idx][hGun][0] = cache_get_field_content_int(idx-1, "hGun1", base);
HomeInfo[idx][hGun][1] = cache_get_field_content_int(idx-1, "hGun2", base);
HomeInfo[idx][hGun][2] = cache_get_field_content_int(idx-1, "hGun3", base);
HomeInfo[idx][hGun][3] = cache_get_field_content_int(idx-1, "hGun4", base);
HomeInfo[idx][hGun][4] = cache_get_field_content_int(idx-1, "hGun5", base);
HomeInfo[idx][hGunAmmo][0] = cache_get_field_content_int(idx-1, "hGunAmmo1", base);
HomeInfo[idx][hGunAmmo][1] = cache_get_field_content_int(idx-1, "hGunAmmo2", base);
HomeInfo[idx][hGunAmmo][2] = cache_get_field_content_int(idx-1, "hGunAmmo3", base);
HomeInfo[idx][hGunAmmo][3] = cache_get_field_content_int(idx-1, "hGunAmmo4", base);
HomeInfo[idx][hGunAmmo][4] = cache_get_field_content_int(idx-1, "hGunAmmo5", base);
HomeInfo[idx][hOnline] = 0;
TOTALHOUSE++;
if(HomeInfo[idx][hOwned] == 0)
{
HomeInfo[idx][hTakings] = 100;
HomeInfo[idx][hNarko] = 0;
HomeInfo[idx][hLock] = 1;
HomeInfo[idx][hHel] = 0;
HomeInfo[idx][hPickup] = CreateDynamicCP(HomeInfo[idx][hEntrance][0], HomeInfo[idx][hEntrance][1], HomeInfo[idx][hEntrance][2], 1.0, 0, 0, -1, 10.0);
//HomeInfo[h][hPickup] = CreatePickupAC(1273, 23, HomeInfo[h][hEntrance][0], HomeInfo[h][hEntrance][1], HomeInfo[h][hEntrance][2],-1);
HomeInfo[idx][hMIcon] = CreateDynamicMapIcon(HomeInfo[idx][hEntrance][0], HomeInfo[idx][hEntrance][1], HomeInfo[idx][hEntrance][2], 31, -1, 0, -1, -1, 100.0);
}
if(HomeInfo[idx][hOwned] == 1)
{
//HomeInfo[h][hPickup] = CreatePickupAC(1272, 23, HomeInfo[h][hEntrance][0], HomeInfo[h][hEntrance][1], HomeInfo[h][hEntrance][2],-1);
HomeInfo[idx][hPickup] = CreateDynamicCP(HomeInfo[idx][hEntrance][0], HomeInfo[idx][hEntrance][1], HomeInfo[idx][hEntrance][2], 1.0, 0, 0, -1, 10.0);
HomeInfo[idx][hMIcon] = CreateDynamicMapIcon(HomeInfo[idx][hEntrance][0], HomeInfo[idx][hEntrance][1], HomeInfo[idx][hEntrance][2], 32, -1, 0, -1, -1, 100.0);
}
}
}
printf("- %i домов загружено за %i (ms)",TOTALHOUSE,GetTickCount() - time);
return true;
}

underwoker
24.04.2014, 22:02
Решено, мешала mysql_debug

Salvacore
24.04.2014, 23:25
Closed.