{"action":"created","issue":{"url":"https://api.github.com/repos/mapbox/earcut.hpp/issues/32","repository_url":"https://api.github.com/repos/mapbox/earcut.hpp","labels_url":"https://api.github.com/repos/mapbox/earcut.hpp/issues/32/labels{/name}","comments_url":"https://api.github.com/repos/mapbox/earcut.hpp/issues/32/comments","events_url":"https://api.github.com/repos/mapbox/earcut.hpp/issues/32/events","html_url":"https://github.com/mapbox/earcut.hpp/pull/32","id":133454583,"number":32,"title":"Add Visual Studio 2013 and 2015 support","user":{"login":"mrgreywater","id":2902403,"avatar_url":"https://avatars.githubusercontent.com/u/2902403?v=3","gravatar_id":"","url":"https://api.github.com/users/mrgreywater","html_url":"https://github.com/mrgreywater","followers_url":"https://api.github.com/users/mrgreywater/followers","following_url":"https://api.github.com/users/mrgreywater/following{/other_user}","gists_url":"https://api.github.com/users/mrgreywater/gists{/gist_id}","starred_url":"https://api.github.com/users/mrgreywater/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrgreywater/subscriptions","organizations_url":"https://api.github.com/users/mrgreywater/orgs","repos_url":"https://api.github.com/users/mrgreywater/repos","events_url":"https://api.github.com/users/mrgreywater/events{/privacy}","received_events_url":"https://api.github.com/users/mrgreywater/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-02-13T17:59:08Z","updated_at":"2016-02-15T21:00:42Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/mapbox/earcut.hpp/pulls/32","html_url":"https://github.com/mapbox/earcut.hpp/pull/32","diff_url":"https://github.com/mapbox/earcut.hpp/pull/32.diff","patch_url":"https://github.com/mapbox/earcut.hpp/pull/32.patch"},"body":"This adds support for the Microsoft Visual C++ Compiler including the tests, viz and bench. It sadly requires some MSVC specific hacks to make it work. \r\n\r\nIn particular MSVC doesn't like the large inline initialization of std::vectors for the fixtures and just hangs indefinitely (>20 min) trying to optimize them, so it is required to disable optimization for those files. I don't particularly like it, but the only other way to resolve this are either use resource files, using static c-arrays, or loading the fixtures at runtime from the working directory. But this would have downsides aswell.\r\n\r\n_edit: I may have found a better way to workaround that bug, **Don't merge yet please**._\r\n\r\nThis PR replaces lots of usages of printf with c++ streams, as they were using non-standard formatting options that are not available in msvc.\r\n\r\nIt also changes very few functions that use c++14 features that were not available with VC12 yet.\r\n\r\nVC14 Release x86 - Windows 10 x64\r\n```\r\n+----------------+--------------------+--------------------+\r\n| Polygon        | earcut             | libtess2           |\r\n+----------------+--------------------+--------------------+\r\n| bad_hole       |      133.717 ops/s |       59.204 ops/s |\r\n| building       |    1.458.977 ops/s |      133.365 ops/s |\r\n| degenerate     |    3.179.523 ops/s |      202.700 ops/s |\r\n| dude           |       77.824 ops/s |       31.110 ops/s |\r\n| empty_square   |    2.012.103 ops/s |      192.166 ops/s |\r\n| water_huge     |          102 ops/s |          100 ops/s |\r\n| water_huge2    |           47 ops/s |          133 ops/s |\r\n| water          |        1.127 ops/s |          264 ops/s |\r\n| water2         |        1.002 ops/s |        1.431 ops/s |\r\n| water3         |       26.433 ops/s |       14.437 ops/s |\r\n| water3b        |      322.550 ops/s |       92.996 ops/s |\r\n| water4         |        4.052 ops/s |        2.966 ops/s |\r\n+----------------+--------------------+--------------------+\r\n```\r\nVC12 Release x86 - Windows 10 x64\r\n```\r\n+----------------+--------------------+--------------------+\r\n| Polygon        | earcut             | libtess2           |\r\n+----------------+--------------------+--------------------+\r\n| bad_hole       |      137.110 ops/s |       58.447 ops/s |\r\n| building       |    1.558.104 ops/s |      129.256 ops/s |\r\n| degenerate     |    3.483.275 ops/s |      192.088 ops/s |\r\n| dude           |       73.920 ops/s |       30.810 ops/s |\r\n| empty_square   |    2.092.300 ops/s |      184.995 ops/s |\r\n| water_huge     |          104 ops/s |          100 ops/s |\r\n| water_huge2    |           48 ops/s |          134 ops/s |\r\n| water          |        1.164 ops/s |          270 ops/s |\r\n| water2         |          953 ops/s |        1.443 ops/s |\r\n| water3         |       25.752 ops/s |       14.466 ops/s |\r\n| water3b        |      333.720 ops/s |       91.763 ops/s |\r\n| water4         |        4.043 ops/s |        2.901 ops/s |\r\n+----------------+--------------------+--------------------+\r\n```\r\nGCC 4.9.2 -O3 -march=native - Ubuntu 14.04\r\n```\r\n+----------------+--------------------+--------------------+\r\n| Polygon        | earcut             | libtess2           |\r\n+----------------+--------------------+--------------------+\r\n| bad_hole       |      164.130 ops/s |       19.787 ops/s |\r\n| building       |    1.819.283 ops/s |       51.033 ops/s |\r\n| degenerate     |    3.543.121 ops/s |       89.198 ops/s |\r\n| dude           |      108.706 ops/s |       11.556 ops/s |\r\n| empty_square   |    2.406.061 ops/s |       75.893 ops/s |\r\n| water_huge     |           88 ops/s |           60 ops/s |\r\n| water_huge2    |           43 ops/s |           76 ops/s |\r\n| water          |        1.206 ops/s |          160 ops/s |\r\n| water2         |        1.385 ops/s |          709 ops/s |\r\n| water3         |       38.820 ops/s |        5.360 ops/s |\r\n| water3b        |      431.561 ops/s |       32.419 ops/s |\r\n| water4         |        5.000 ops/s |        1.293 ops/s |\r\n+----------------+--------------------+--------------------+\r\n```\r\nInterestingly libtess2 seems about twice as fast with Windows/MSVC (I guess the Windows 10 heap allocator is faster?)"},"comment":{"url":"https://api.github.com/repos/mapbox/earcut.hpp/issues/comments/184390775","html_url":"https://github.com/mapbox/earcut.hpp/pull/32#issuecomment-184390775","issue_url":"https://api.github.com/repos/mapbox/earcut.hpp/issues/32","id":184390775,"user":{"login":"mrgreywater","id":2902403,"avatar_url":"https://avatars.githubusercontent.com/u/2902403?v=3","gravatar_id":"","url":"https://api.github.com/users/mrgreywater","html_url":"https://github.com/mrgreywater","followers_url":"https://api.github.com/users/mrgreywater/followers","following_url":"https://api.github.com/users/mrgreywater/following{/other_user}","gists_url":"https://api.github.com/users/mrgreywater/gists{/gist_id}","starred_url":"https://api.github.com/users/mrgreywater/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrgreywater/subscriptions","organizations_url":"https://api.github.com/users/mrgreywater/orgs","repos_url":"https://api.github.com/users/mrgreywater/repos","events_url":"https://api.github.com/users/mrgreywater/events{/privacy}","received_events_url":"https://api.github.com/users/mrgreywater/received_events","type":"User","site_admin":false},"created_at":"2016-02-15T21:00:42Z","updated_at":"2016-02-15T21:00:42Z","body":"will do, I missed that generator."}}