Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - lawsonk

Pages: [1]
1
General / Visual Studio Debug/Release Issues
« on: October 17, 2016, 04:01:17 am »
I used SFML to create a graphical rendering of the classic Traveling Salesman Problem, which would be solved used a Genetic Algorithm.

Using the debug build version I find that the program runs as expected, albeit at a very low frame rate.
https://www.youtube.com/embed/LYPndQ5kdmo

However using the release build version I find that the counter I used to display the current generation climbs very quickly and that the framerate is no longer limited. It seems almost like part of the code is being skipped so the frame can finish as soon as possible.


If you notice the generation counter doesn't appear to match the redrawing of the tours.

I've tried setting the optimization setting for release to disabled, however, that doesn't change anything. Nor do I think it has anything to do with the included sfml-xxx.dll files.


My Debug Folder


My Release Folder


I'm using SFML 2.3.2

Frames are locked using ...
window.setFramerateLimit(60);

This following two snippets of code should only run once per frame.
Although I have my doubts that this is the cause of the issue.
if (!paused)
                {
                        generations++;
                        textDisplayHandler.editText(3, "Generations: " + std::to_string(generations));
                        geneticAlgorithm.setTourReference(tourHandler.getTourReference());
                        geneticAlgorithm.generateTours();
                }

renderHandler.Draw();
 
// Draw Definition
void RenderHandler::Draw()
{
        rw_->clear();
        tour_->drawTours();
        text_->drawText();
        city_->drawCities();
       
        rw_->display();
}
 

Anyone have any idea why there might be such a discrepancy between the two build versions?

Pages: [1]
anything