-optimize
Enables or disables compiler optimizations.
Syntax
-optimize[ + | - ]
Arguments
Term | Definition |
---|---|
+ | - |
Optional. The -optimize- option disables compiler optimizations. The -optimize+ option enables optimizations. By default, optimizations are disabled. |
Remarks
Compiler optimizations make your output file smaller, faster, and more efficient. However, because optimizations result in code rearrangement in the output file, -optimize+
can make debugging difficult.
All modules generated with -target:module
for an assembly must use the same -optimize
settings as the assembly. For more information, see -target (Visual Basic).
You can combine the -optimize
and -debug
options.
To set -optimize in the Visual Studio integrated development environment |
---|
1. Have a project selected in Solution Explorer. On the Project menu, click Properties. 2. Click the Compile tab. 3. Click the Advanced button. 4. Modify the Enable optimizations check box. |
Example
The following code compiles T2.vb
and enables compiler optimizations.
vbc t2.vb -optimize
See also
Cộng tác với chúng tôi trên GitHub
Bạn có thể tìm thấy nguồn cho nội dung này trên GitHub, nơi bạn cũng có thể tạo và xem lại các vấn đề và yêu cầu kéo. Để biết thêm thông tin, hãy xem hướng dẫn dành cho người đóng góp của chúng tôi.
Phản hồi
https://aka.ms/ContentUserFeedback.
Sắp ra mắt: Trong năm 2024, chúng tôi sẽ dần gỡ bỏ Sự cố với GitHub dưới dạng cơ chế phản hồi cho nội dung và thay thế bằng hệ thống phản hồi mới. Để biết thêm thông tin, hãy xem:Gửi và xem ý kiến phản hồi dành cho