VS7 and VS2003 sucks.
От: Andy77 Ниоткуда  
Дата: 01.08.03 15:19
Оценка: 44 (4) :)
#Имя: FAQ.tools.vc71.bugs2
запустите ЭТО в Debug и Release (default optimization settings) и сравните результаты.


#include <iostream>
#include <tchar.h>

int _tmain(int argc, _TCHAR* argv[])
{
    char c[4];
    c[0]='a';
    c[1]='b';
    c[2]='c';
    c[3]='d';

    std::cout << "before: " << c[0] << c[1] << c[2] << c[3] << std::endl;
    
    for (int n=2 ; n>0; --n)
    {
        for (int i=0; i<3; i++)
        {
            c[i] = c[i+1];
        }
        c[3] = 'x';
    }

    std::cout << "after: " << c[0] << c[1] << c[2] << c[3] << std::endl;
    return 0;
}
Re[3]: VS7 and VS2003 sucks.
От: Odi$$ey Россия http://malgarr.blogspot.com/
Дата: 02.08.03 04:19
Оценка: 26 (3)
Здравствуйте, Andy77, Вы писали:

A>кстати, что это за "рекомендации лучших собаководов",


это у Роббинсона, в "Отладке приложений" есть такой пассаж:

/O1 (minimize size)

By default, a project created by the Microsoft Foundation Class (MFC) library AppWizard uses /O2 (maximize speed) for its release-build configurations. However, Microsoft builds all its commercial applications with /O1, and that's what you should be using. What Microsoft has found is that after picking the best algorithm and writing tight code, avoiding page faults can help speed up your application considerably. As I've heard it said, "Page faults can ruin your day!"

Page faults occur when your executing code moves from one page of memory (4 KB for x86 Intel) to the next. To resolve a page fault, the operating system must stop executing your program and place the new page on the CPU. If the page fault is soft, meaning that the page is already in memory, the overhead isn't too terrible—but it's extra overhead nonetheless. If the page fault is hard, however, the operating system must go out to disk and bring the page into memory. As you can imagine, this little trip will cause hundreds of thousands of instructions to execute, slowing down your application. By minimizing the size of your binary, you decrease the total number of pages your application uses, thereby reducing the number of page faults. Granted, the operating system's loaders and cache management are quite good, but why take more page faults than you have to?


A>неужели М$ признаёт наличие кучи багов в VS7/VS2003?


такой информации у меня нет
Re: VS7 and VS2003 sucks.
От: siv Украина  
Дата: 29.08.06 07:08
Оценка: 11 (2) +1
Проверил в SP1 — вылечили.
Re: VS7 and VS2003 sucks.
От: Odi$$ey Россия http://malgarr.blogspot.com/
Дата: 01.08.03 15:46
Оценка:
Здравствуйте, Andy77, Вы писали:

A>запустите ЭТО в Debug и Release (default optimization settings) и сравните результаты.


хм, зависит от оптимизации Release, если по умолчанию — Maximize Speed, то разные, а если по рекомендациям лучших собаководов — Minimize Size, то также как в Debug
Re[2]: VS7 and VS2003 sucks.
От: Andy77 Ниоткуда  
Дата: 01.08.03 16:48
Оценка:
Здравствуйте, Odi$$ey, Вы писали:

OE>хм, зависит от оптимизации Release, если по умолчанию — Maximize Speed, то разные, а если по рекомендациям лучших собаководов — Minimize Size, то также как в Debug


ну да.
кстати, что это за "рекомендации лучших собаководов", неужели М$ признаёт наличие кучи багов в VS7/VS2003?
Re: VS7 and VS2003 sucks.
От: Lexey Россия  
Дата: 04.08.03 15:03
Оценка:
Здравствуйте, Andy77, Вы писали:

A>запустите ЭТО в Debug и Release (default optimization settings) и сравните результаты.

A>

Мда, глюкодром.
Re[4]: VS7 and VS2003 sucks.
От: Eduard-x Германия www.ruforum.de
Дата: 09.04.04 09:13
Оценка:
Приветствую, земляне!
Не подскажете, где книжкнцию сию можно откопать? stirliz1@gmx.net премного благодарен.

OE>это у Роббинсона, в "Отладке приложений" есть такой пассаж:


OE>

OE>/O1 (minimize size)

OE>By default, a project created by the Microsoft Foundation Class (MFC) library AppWizard uses /O2 (maximize speed) for its release-build configurations. However, Microsoft builds all its commercial applications with /O1, and that's what you should be using. What Microsoft has found is that after picking the best algorithm and writing tight code, avoiding page faults can help speed up your application considerably. As I've heard it said, "Page faults can ruin your day!"

OE>Page faults occur when your executing code moves from one page of memory (4 KB for x86 Intel) to the next. To resolve a page fault, the operating system must stop executing your program and place the new page on the CPU. If the page fault is soft, meaning that the page is already in memory, the overhead isn't too terrible—but it's extra overhead nonetheless. If the page fault is hard, however, the operating system must go out to disk and bring the page into memory. As you can imagine, this little trip will cause hundreds of thousands of instructions to execute, slowing down your application. By minimizing the size of your binary, you decrease the total number of pages your application uses, thereby reducing the number of page faults. Granted, the operating system's loaders and cache management are quite good, but why take more page faults than you have to?

Re[4]: VS7 and VS2003 sucks.
От: Аноним  
Дата: 09.04.04 10:55
Оценка:
Здравствуйте, Odi$$ey, Вы писали:

OE>Здравствуйте, Andy77, Вы писали:


A>>кстати, что это за "рекомендации лучших собаководов",


OE>это у Роббинсона, в "Отладке приложений" есть такой пассаж:


OE>

Intel) to the next. To resolve a page fault, the operating system must stop executing your program and place the new page on the CPU. If the page fault is soft, meaning that the page is already in memory, the overhead isn't too terrible—but it's extra overhead nonetheless. If the page fault is hard, however, the operating system must go out to disk and bring the page into memory.


IMHO это что-то новое в компьютеростроении.
Неужели при проходе каждых 4k возникает Page Fault, даже если страница в памяти?
Что такое Soft Page Fault, Первый раз слышу. IMHO что-то такое можно изобразить, если вставить в комп > 4GB оперативки, но это пока не про нас.
Да, заново транслируются адреса для новой страницы, но это не так смертельно.
Re[5]: VS7 and VS2003 sucks.
От: Аноним  
Дата: 09.04.04 11:29
Оценка:
Здравствуйте, Eduard-x, Вы писали:

EX>Приветствую, земляне!

EX>Не подскажете, где книжкнцию сию можно откопать? stirliz1@gmx.net премного благодарен.

http://www.amazon.com/exec/obidos/tg/detail/-/0735608865
http://www.amazon.com/exec/obidos/tg/detail/-/0735615365
Re: VS7 and VS2003 sucks.
От: shmakov Россия  
Дата: 12.10.04 12:12
Оценка:
Тут скорее всего оптимизатор считает что работает со строками — если добавить в конец \0
то всё начинает работать нормально...

Хотя действительно бага.
Re[2]: VS7 and VS2003 sucks.
От: Максим Зелинский  
Дата: 29.08.06 10:44
Оценка:
Здравствуйте, siv, Вы писали:

siv>Проверил в SP1 — вылечили.

Уважаемый, а есть смысл в том, что ты поднимаешь трехгодичные темы?
Re[3]: VS7 and VS2003 sucks.
От: spine Россия http://ruby.inuse.ru
Дата: 29.08.06 15:52
Оценка:
Здравствуйте, Максим Зелинский, Вы писали:

МЗ>Здравствуйте, siv, Вы писали:


siv>>Проверил в SP1 — вылечили.

МЗ>Уважаемый, а есть смысл в том, что ты поднимаешь трехгодичные темы?
Для меня есть, этого мало?
Re[3]: VS7 and VS2003 sucks.
От: VladFein США  
Дата: 29.08.06 19:41
Оценка:
Здравствуйте, Максим Зелинский, Вы писали:

siv>>Проверил в SP1 — вылечили.

МЗ>Уважаемый, а есть смысл в том, что ты поднимаешь трехгодичные темы?
Так ведь SP1 только что выпустили.
Человек проверил — ошибка исправлена. В чем проблема то?

Кстати, надо говорить не "VS7 and VS2003 sucks", а "VS7 and VS2003 suck" или "VS7 sucks and VS2003 sucks".
К тому же, если VS7 — тогда VS7.1;
если VS2003 — тогда VS2002
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.