Armenian Knowledge Base  

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

Reply
 
LinkBack Thread Tools
Old 25.03.2003, 05:39   #1
Авик
 
CyberJoe's Avatar
 
Join Date: 07 2002
Location: Yerevan
Age: 30
Posts: 1,348
Downloads: 2
Uploads: 0
Reputation: 9 | 0
Default Problema optimizacii

Kak na Visual C++, Basic sdelat progu malenkoj,bistroj
(derektivi kompiljatora)
Reply With Quote
Old 25.03.2003, 07:50   #2
»
 
z0mbie's Avatar
 
Join Date: 01 2002
Posts: 777
Downloads: 1
Uploads: 0
Reputation: 0 | 0
Default

Project->Settings(Alt+F7)->C/C++->Optimizations
Reply With Quote
Old 25.03.2003, 09:58   #3
Грустно...
 
Agregat's Avatar
 
Join Date: 08 2002
Location: Там, где всегда идут дожди
Age: 35
Posts: 21,717
Downloads: 2
Uploads: 0
Reputation: 250 | 7
Default

Отмечу, что еще надо хорошо писать программы. Возможно это не поможет с размером, но уж точно поможет со скоростью. Хотя run time size - тоже очень зависит от того, как программа написанна.
Reply With Quote
Old 25.03.2003, 13:21   #4
Авик
 
CyberJoe's Avatar
 
Join Date: 07 2002
Location: Yerevan
Age: 30
Posts: 1,348
Downloads: 2
Uploads: 0
Reputation: 9 | 0
Default Re: Problema optimizacii

Spasibo ogromnoe a kak dlja vb?
Reply With Quote
Old 25.03.2003, 14:01   #5
Академик
 
greka's Avatar
 
Join Date: 09 2001
Location: inside myself
Posts: 5,369
Downloads: 0
Uploads: 0
Reputation: 18 | 5
Default

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

залог успеха в любой среде программирования, имхо.
Reply With Quote
Old 25.03.2003, 14:42   #6
Грустно...
 
Agregat's Avatar
 
Join Date: 08 2002
Location: Там, где всегда идут дожди
Age: 35
Posts: 21,717
Downloads: 2
Uploads: 0
Reputation: 250 | 7
Default Re: Re: Problema optimizacii

Quote:
Originally posted by CyberJoe
Spasibo ogromnoe a kak dlja vb?
Учитывая то, что VB является интерпретируемым языком я думаю, что об оптимизации по скорости говорить не имеет особого смысла. С другой стороны файлы VB - по размеру очень маленькие, правда с ними нужны тяжелые VBRun длл-ки. Вот....
мое собственное ИМХО
Reply With Quote
Old 26.03.2003, 07:01   #7
Авик
 
CyberJoe's Avatar
 
Join Date: 07 2002
Location: Yerevan
Age: 30
Posts: 1,348
Downloads: 2
Uploads: 0
Reputation: 9 | 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.
Reply With Quote
Old 26.03.2003, 08:14   #8
Академик
 
greka's Avatar
 
Join Date: 09 2001
Location: inside myself
Posts: 5,369
Downloads: 0
Uploads: 0
Reputation: 18 | 5
Default

2 CyberJoe: privedesh' eti zagadocnye stroki zdes' ?
interesno budet posmotret'.
Reply With Quote
Old 26.03.2003, 08:22   #9
»
 
z0mbie's Avatar
 
Join Date: 01 2002
Posts: 777
Downloads: 1
Uploads: 0
Reputation: 0 | 0
Default

загадочные строчки-это опции линкера типа
#pragma comment(linker,"...")
Reply With Quote
Old 31.03.2003, 06:53   #10
Авик
 
CyberJoe's Avatar
 
Join Date: 07 2002
Location: Yerevan
Age: 30
Posts: 1,348
Downloads: 2
Uploads: 0
Reputation: 9 | 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")
Reply With Quote
Old 31.03.2003, 07:49   #11
Академик
 
greka's Avatar
 
Join Date: 09 2001
Location: inside myself
Posts: 5,369
Downloads: 0
Uploads: 0
Reputation: 18 | 5
Wink

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

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

а кто может мне объяснить влияние этих двух опций :-?
Reply With Quote
Old 31.03.2003, 08:27   #12
»
 
z0mbie's Avatar
 
Join Date: 01 2002
Posts: 777
Downloads: 1
Uploads: 0
Reputation: 0 | 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 With Quote
Sponsored Links
Reply

Thread Tools


На правах рекламы:
реклама

All times are GMT. The time now is 05:00.


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