RU/2: Форум. Общение пользователей и разработчиков OS/2 (eCS). : Ответить на сообщение
Имя:
e-mail:
FIDO:
Home page:
сохранить данные о вас
Тема:
> > > Ну допустим у меня есть сильное подозрение на плохую работу malloc-free, > > которые активно используется в многочисленных циклах. Не переписывать же > > по этому поводу сорцы? Проблемы в том что все вышезаявленные ранее программы > > типа rar, infozip, ... почти не пользуются динамической памятью во время работы, > > а консольная часть моего проекта не влияет (ПОВТОРЯЮСЬ!!!) на результаты теста. > > И хватит косить на VIO/MOU/KBD проблемы реально сидят в DOSCALLS. > > > В примерах VP есть программа memmgrex > Результаты работы > OS/2 Intel Celeron 433 > Test: Simple Get/FreeMem Total Calls Time/msec > - GetMem 1000 0.45 > - FreeMem 1000 0.49 > - ReAllocMem 1000 1.92 > > Test: Exceptions Total Calls Time/msec > - GetMem 2999 8.55 > - FreeMem 3002 4.86 > - ReAllocMem 0 0.00 > > Test: TStringList usage Total Calls Time/msec > - GetMem 2002 60.23 > - FreeMem 2004 13.79 > - ReAllocMem 1064 162.67 > > ------------------------ > Total execution time : 405.29 msec > Of which Memory Management : 252.96 msec > > Windows98 Intel Celeron 466 > Test: Simple Get/FreeMem Total Calls Time/msec > - GetMem 1000 0.55 > - FreeMem 1000 0.50 > - ReAllocMem 1000 1.93 > > Test: Exceptions Total Calls Time/msec > - GetMem 2999 6.92 > - FreeMem 3002 2.74 > - ReAllocMem 0 0.00 > > Test: TStringList usage Total Calls Time/msec > - GetMem 2002 87.55 > - FreeMem 2004 47.61 > - ReAllocMem 1064 211.44 > > ------------------------ > Total execution time : 582.70 msec > Of which Memory Management : 359,25 msec > > И ещё один тест > Program search; > > Uses Use32, Dos, VPUtils, Os2Def, Os2Base; > var > seek_pos: Ulong; > UCString: Array [0..16] of Char; > LCString: Array [0..16] of Char; > txt_ln: Ulong; > Str_ln: Ulong; > Count: Ulong; > CTbl: Array[0..1023] of Byte; > abBuffer: Array[0..65535*32] of Byte; > Ulrc: ApiRet; > Hf: HFile; > UlAction: Ulong; > CbRead: Ulong; > tm: Ulong; > etm: Ulong; > Procedure prn_res; > begin > Writeln('Found at offset ',seek_pos - str_ln); > end; > Procedure Build_Tbl; > begin > asm > mov edi,offset CTbl > mov ecx,256 > xor eax,eax > rep stosd > mov esi,offset UCString > mov ecx,[str_ln] > mov edx,80000000h > mov edi,offset CTbl > @Build_Tbl1: > xor eax,eax > lodsb > shl eax,2 > or [edi+eax],edx > shr edx,1 > loop @Build_Tbl1 > mov esi,offset LCString > mov edi,offset CTbl > mov ecx,[str_ln] > mov edx,80000000h > @Build_Tbl2: > xor eax,eax > lodsb > shl eax,2 > or [edi+eax],edx > shr edx,1 > loop @Build_Tbl2 > end; > end; > > Procedure Search_Str; > begin > asm > mov edi,offset Ctbl > mov esi,offset abBuffer > mov ecx,[str_ln] > dec ecx > mov ebx,[cbRead] > mov edx,80000000h > shr edx,cl > mov ecx,ebx > mov ebx,edx > xor edx,edx > @sr1: xor eax,eax > lodsb > inc [seek_pos] > shl ax,2 > shr edx,1 > or edx,80000000h > and edx,[edi+eax] > push edx > and edx,ebx > or edx,edx > pop edx > jnz @found > loop @sr1 > jmp @exit > @found: > pushad > inc [count] > call prn_res > popad > jecxz @exit > jmp @sr1 > @exit: > end; > end; > Begin > UCString := 'STRING FOR SEARCH'; > LCString := 'string_for_search'; > str_ln:=17; > txt_ln:=65535*32; > seek_pos:=0; > > Build_Tbl; > tm:=GetTimemsec; > > ulrc := DosOpen( > 'test_file.dat', > hf, > ulAction, > 0, > file_Normal, > file_Open, > open_access_ReadOnly or > open_share_DenyNone, > nil); > > If ulrc = 0 then > begin > tm:= GetTimemsec; > cbRead:=65535*32; > While cbRead <> 0 do > begin > DosRead( > hf, > abBuffer, > sizeof(abBuffer), > cbRead); > If cbRead<>0 then Search_Str; > end; > DosClose(hf); > etm:= getTimemsec-tm; > WriteLn('Reading ',seek_pos,' bytes'); > WriteLn('Found ',count,' strings'); > Writeln('Elapsed time is ',etm,' mSec'); > end; > end. > > > OS/2 c заремленным call prn_res > > Reading 80668225 bytes > Found 2592 strings > Elapsed time is 6210 mSec > > с перенапровлением вывода в файл > > Reading 80668225 bytes > Found 2592 strings > Elapsed time is 6990 mSec > > Windows98 > Перекомпайлено на Delfi c заменой соответствующих API > Первый случай ок.32 сек. > Второй случай больше двух минут > Так-же рекомендую сравнить NEON3D и True Spectra под OS/2 и NT
__, _,_ __, _,_ _,
|_) | | | \ | / /_\
| \ | | |_/ |/ | |
~ ~ `~' ~ ~ ~ ~
Programmed by
Dmitri Maximovich
,
Dmitry I. Platonoff
,
Eugen Kuleshov
.
25.09.99 (c) 1999,
RU/2
. All rights reserved.
Rewritten by
Dmitry Ban
. All rights ignored.