Go Back   Armenian Knowledge Base > Technical sections > Languages, Compilers, Interpreters

Reply
 
Thread Tools

Problema optimizacii
Old 25.03.2003, 05:39   #1
Авик
 
CyberJoe's Avatar
 
Join Date: 07 2002
Location: Yerevan
Age: 38
Posts: 1,348
Rep Power: 0
Default Problema optimizacii

Kak na Visual C++, Basic sdelat progu malenkoj,bistroj
(derektivi kompiljatora)

Old 25.03.2003, 07:50   #2
»
 
z0mbie's Avatar
 
Join Date: 01 2002
Posts: 777
Rep Power: 0
Default

Project->Settings(Alt+F7)->C/C++->Optimizations

Old 25.03.2003, 09:58   #3
Грустно...
 
Agregat's Avatar
 
Join Date: 08 2002
Location: Там, где всегда идут дожди
Age: 43
Posts: 21,717
Rep Power: 9
Default

Отмечу, что еще надо хорошо писать программы. Возможно это не поможет с размером, но уж точно поможет со скоростью. Хотя run time size - тоже очень зависит от того, как программа написанна.
__________________
http://аvitya.livejournal.com
Хотели, как лучше, а получилось даже хуже...
Лозунг шахматиста: На каждый шах - ответим матом!

Re: Problema optimizacii
Old 25.03.2003, 13:21   #4
Авик
 
CyberJoe's Avatar
 
Join Date: 07 2002
Location: Yerevan
Age: 38
Posts: 1,348
Rep Power: 0
Default Re: Problema optimizacii

Spasibo ogromnoe a kak dlja vb?

Old 25.03.2003, 14:01   #5
Академик
 
greka's Avatar
 
Join Date: 09 2001
Location: inside myself
Posts: 5,369
Rep Power: 6
Default

продуманный алгоритм + _ограничение_ себя в использовании MFC-шных классов + знание (внутренней работы) системы, для которой пишется софт.

залог успеха в любой среде программирования, имхо.
__________________
И повешенные могут качаться в неположенную сторону. /С.Е.Лец/

Re: Re: Problema optimizacii
Old 25.03.2003, 14:42   #6
Грустно...
 
Agregat's Avatar
 
Join Date: 08 2002
Location: Там, где всегда идут дожди
Age: 43
Posts: 21,717
Rep Power: 9
Default Re: Re: Problema optimizacii

Quote:
Originally posted by CyberJoe
Spasibo ogromnoe a kak dlja vb?
Учитывая то, что VB является интерпретируемым языком я думаю, что об оптимизации по скорости говорить не имеет особого смысла. С другой стороны файлы VB - по размеру очень маленькие, правда с ними нужны тяжелые VBRun длл-ки. Вот....
мое собственное ИМХО
__________________
http://аvitya.livejournal.com
Хотели, как лучше, а получилось даже хуже...
Лозунг шахматиста: На каждый шах - ответим матом!

Re: Problema optimizacii
Old 26.03.2003, 07:01   #7
Авик
 
CyberJoe's Avatar
 
Join Date: 07 2002
Location: Yerevan
Age: 38
Posts: 1,348
Rep Power: 0
Default Re: Problema optimizacii

Quote:
Originally posted by CyberJoe
Kak na Visual C++, Basic sdelat progu malenkoj,bistroj
(derektivi kompiljatora)
Nu ja naprimer w journale xakep chital (kak piast trojan na c++)
dam bilo para zagadochnix strochek kotorie umenshali
progu do 1kb!!!

nu a algoritm ja starajus pisat akkuratno.

Old 26.03.2003, 08:14   #8
Академик
 
greka's Avatar
 
Join Date: 09 2001
Location: inside myself
Posts: 5,369
Rep Power: 6
Default

2 CyberJoe: privedesh' eti zagadocnye stroki zdes' ?
interesno budet posmotret'.
__________________
И повешенные могут качаться в неположенную сторону. /С.Е.Лец/

Old 26.03.2003, 08:22   #9
»
 
z0mbie's Avatar
 
Join Date: 01 2002
Posts: 777
Rep Power: 0
Default

загадочные строчки-это опции линкера типа
#pragma comment(linker,"...")

Old 31.03.2003, 05:53   #10
Авик
 
CyberJoe's Avatar
 
Join Date: 07 2002
Location: Yerevan
Age: 38
Posts: 1,348
Rep Power: 0
Default

Quote:
Originally posted by Greco
2 CyberJoe: privedesh' eti zagadocnye stroki zdes' ?
interesno budet posmotret'.
На смотри и радвуйся!
#pragma comment(linker,"/MERGE:.rdata=.text")
#pragma comment(linker,"/FILEALIGN:512 /SECTION:.text,EWRX
/IGNORE:4078")
#pragma comment(linker,"/ENTRY:WinMain")
__________________
вот собственно все, что я хотел сказать.

Old 31.03.2003, 06:49   #11
Академик
 
greka's Avatar
 
Join Date: 09 2001
Location: inside myself
Posts: 5,369
Rep Power: 6
Wink

интересными являются опции:

#pragma comment(linker,"/MERGE:.rdata=.text")
#pragma comment(linker,"/FILEALIGN:512 /SECTION:.text...

а кто может мне объяснить влияние этих двух опций :-?
__________________
И повешенные могут качаться в неположенную сторону. /С.Е.Лец/

Old 31.03.2003, 07:27   #12
»
 
z0mbie's Avatar
 
Join Date: 01 2002
Posts: 777
Rep Power: 0
Default

/MERGE:from=to

This option combines the first section (from) with the second section (to), naming the resulting section to. If the second section does not exist, LINK renames the section from as to.


The .text section is where all general-purpose code emitted by the compiler
or assembler ends up.

The .rdata section is used for at least four things. First, in EXEs produced by
Microsoft Link, the .rdata section holds the debug directory
The second useful portion of an .rdata section is the description string. If
you specified a DESCRIPTION entry in your program's .DEF file, the specified
description string appears in the .rdata section.
A third use of the .rdata section is for GUIDs used in OLE programming.
The UUID.LIB import library contains a collection of 16-byte GUIDs that are
used for things such as interface IDs. These GUIDs end up in the EXE or
DLL's .rdata section.
The final use of the .rdata section is as a place to put the
TLS (Thread Local Storage) directory. The TLS directory is a special data
structure used by the compiler runtime library to transparently provide thread
local storage for variables declared in program code.


/SECTION:name,attributes

This option changes the attributes of a section, overriding the attributes set when the .OBJ file for the section was compiled.
Reply




Реклама:
реклама
Buy text link .

All times are GMT. The time now is 08:40.
Top

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.