Improve build performance on Windows slightly

This commit is contained in:
rdb 2015-06-02 21:02:35 +02:00
parent 912374cc51
commit 141c7a9c35
7 changed files with 28 additions and 84 deletions

View File

@ -38,12 +38,17 @@ After acquiring these dependencies, you may simply build Panda3D from the
command prompt using the following command: command prompt using the following command:
```bash ```bash
makepanda\makepanda.bat --everything --installer makepanda\makepanda.bat --everything --installer --no-eigen
``` ```
When the build succeeds, it will produce an .exe file that you can use to When the build succeeds, it will produce an .exe file that you can use to
install Panda3D on your system. install Panda3D on your system.
Note: you may choose to remove --no-eigen and build with Eigen support in
order to improve runtime performance. However, this will cause the build to
take hours to complete, as Eigen is a heavily template-based library, and the
the MSVC compiler does not perform well under these circumstances.
Linux Linux
----- -----

View File

@ -17,7 +17,7 @@
#include "pvector.h" #include "pvector.h"
#if defined(HAVE_EIGEN) && defined(_WIN32) && !defined(CPPPARSER) #if defined(HAVE_EIGEN) && defined(_WIN32) && !defined(_WIN64) && !defined(CPPPARSER)
#include <Eigen/StdVector> #include <Eigen/StdVector>

View File

@ -913,9 +913,19 @@ if (COMPILER=="GCC"):
DefSymbol("WITHINPANDA", "WITHIN_PANDA", "1") DefSymbol("WITHINPANDA", "WITHIN_PANDA", "1")
if GetLinkAllStatic(): if GetLinkAllStatic():
DefSymbol("ALWAYS", "LINK_ALL_STATIC", "") DefSymbol("ALWAYS", "LINK_ALL_STATIC")
if GetTarget() == 'android': if GetTarget() == 'android':
DefSymbol("ALWAYS", "ANDROID", "") DefSymbol("ALWAYS", "ANDROID")
if not PkgSkip("EIGEN"):
DefSymbol("ALWAYS", "EIGEN_MPL2_ONLY")
if GetOptimize() >= 3:
DefSymbol("ALWAYS", "EIGEN_NO_DEBUG")
if COMPILER == "MSVC":
# Squeeze out a bit more performance on MSVC builds...
# Only do this if EIGEN_NO_DEBUG is also set, otherwise it
# will turn them into runtime assertions.
DefSymbol("ALWAYS", "EIGEN_NO_STATIC_ASSERT")
######################################################################## ########################################################################
## ##
@ -1018,10 +1028,10 @@ def CompileCxx(obj,src,opts):
if (optlevel==1): cmd += " /MDd /Zi /RTCs /GS" if (optlevel==1): cmd += " /MDd /Zi /RTCs /GS"
if (optlevel==2): cmd += " /MDd /Zi" if (optlevel==2): cmd += " /MDd /Zi"
if (optlevel==3): cmd += " /MD /Zi /O2 /Ob2 /Oi /Ot /fp:fast /DFORCE_INLINING" if (optlevel==3): cmd += " /MD /Zi /GS- /O2 /Ob2 /Oi /Ot /fp:fast"
if (optlevel==4): if (optlevel==4):
cmd += " /MD /Zi /Ox /Ob2 /Oi /Ot /fp:fast /DFORCE_INLINING /DNDEBUG /GL" cmd += " /MD /Zi /GS- /Ox /Ob2 /Oi /Ot /fp:fast /DFORCE_INLINING /DNDEBUG /GL"
cmd += " /Oy /Zp16" # jean-claude add /Zp16 insures correct static alignment for SSEx cmd += " /Oy /Zp16" # jean-claude add /Zp16 insures correct static alignment for SSEx
cmd += " /Fd" + os.path.splitext(obj)[0] + ".pdb" cmd += " /Fd" + os.path.splitext(obj)[0] + ".pdb"
@ -1036,7 +1046,7 @@ def CompileCxx(obj,src,opts):
if 'EXCEPTIONS' in opts: if 'EXCEPTIONS' in opts:
cmd += " /EHsc" cmd += " /EHsc"
else: else:
cmd += " -D_HAS_EXCEPTIONS=0" cmd += " /D_HAS_EXCEPTIONS=0"
if 'RTTI' not in opts: if 'RTTI' not in opts:
cmd += " /GR-" cmd += " /GR-"

View File

@ -1,27 +0,0 @@
// Filename: vector_LPoint2f.cxx
// Created by: drose (10May00)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) Carnegie Mellon University. All rights reserved.
//
// All use of this software is subject to the terms of the revised BSD
// license. You should have received a copy of this license along
// with this source code in a file named "LICENSE."
//
////////////////////////////////////////////////////////////////////
#include "vector_LPoint2f.h"
#define EXPCL EXPCL_PANDA_LINMATH
#define EXPTP EXPTP_PANDA_LINMATH
#define TYPE LPoint2f
#define NAME vector_LPoint2f
#include "vector_src.cxx"
// Tell GCC that we'll take care of the instantiation explicitly here.
#ifdef __GNUC__
#pragma implementation
#endif

View File

@ -1,43 +0,0 @@
// Filename: vector_LPoint2f.h
// Created by: drose (10May00)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) Carnegie Mellon University. All rights reserved.
//
// All use of this software is subject to the terms of the revised BSD
// license. You should have received a copy of this license along
// with this source code in a file named "LICENSE."
//
////////////////////////////////////////////////////////////////////
#ifndef VECTOR_LPOINT2F_H
#define VECTOR_LPOINT2F_H
#include "pandabase.h"
#include "luse.h"
#include "pvector.h"
////////////////////////////////////////////////////////////////////
// Class : vector_LPoint2f
// Description : A vector of LPoint2fs. This class is defined once here,
// and exported to PANDA.DLL; other packages that want
// to use a vector of this type (whether they need to
// export it or not) should include this header file,
// rather than defining the vector again.
////////////////////////////////////////////////////////////////////
#define EXPCL EXPCL_PANDA_LINMATH
#define EXPTP EXPTP_PANDA_LINMATH
#define TYPE LPoint2f
#define NAME vector_LPoint2f
#include "vector_src.h"
// Tell GCC that we'll take care of the instantiation explicitly here.
#ifdef __GNUC__
#pragma interface
#endif
#endif

View File

@ -15,7 +15,7 @@
#include "convert_srgb.h" #include "convert_srgb.h"
// Lookup tables for converting from unsigned char formats. // Lookup tables for converting from unsigned char formats.
ALIGN_64BYTE const const
unsigned char to_srgb8_table[256] = { 0x00, 0x0d, 0x16, 0x1c, 0x22, 0x26, 0x2a, unsigned char to_srgb8_table[256] = { 0x00, 0x0d, 0x16, 0x1c, 0x22, 0x26, 0x2a,
0x2e, 0x32, 0x35, 0x38, 0x3b, 0x3d, 0x40, 0x42, 0x45, 0x47, 0x49, 0x4b, 0x4d, 0x2e, 0x32, 0x35, 0x38, 0x3b, 0x3d, 0x40, 0x42, 0x45, 0x47, 0x49, 0x4b, 0x4d,
0x4f, 0x51, 0x53, 0x55, 0x56, 0x58, 0x5a, 0x5c, 0x5d, 0x5f, 0x60, 0x62, 0x63, 0x4f, 0x51, 0x53, 0x55, 0x56, 0x58, 0x5a, 0x5c, 0x5d, 0x5f, 0x60, 0x62, 0x63,
@ -38,7 +38,7 @@ unsigned char to_srgb8_table[256] = { 0x00, 0x0d, 0x16, 0x1c, 0x22, 0x26, 0x2a,
0xf9, 0xf9, 0xfa, 0xfa, 0xfb, 0xfb, 0xfb, 0xfc, 0xfc, 0xfd, 0xfd, 0xfe, 0xfe, 0xf9, 0xf9, 0xfa, 0xfa, 0xfb, 0xfb, 0xfb, 0xfc, 0xfc, 0xfd, 0xfd, 0xfe, 0xfe,
0xff, 0xff}; 0xff, 0xff};
ALIGN_64BYTE const const
unsigned char to_linear_uchar_table[256] = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, unsigned char to_linear_uchar_table[256] = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02,
0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04,
@ -61,7 +61,6 @@ unsigned char to_linear_uchar_table[256] = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0xe0, 0xe2, 0xe5, 0xe7, 0xe9, 0xeb, 0xed, 0xef, 0xf2, 0xf4, 0xf6, 0xf8, 0xfa, 0xe0, 0xe2, 0xe5, 0xe7, 0xe9, 0xeb, 0xed, 0xef, 0xf2, 0xf4, 0xf6, 0xf8, 0xfa,
0xfd, 0xff}; 0xfd, 0xff};
ALIGN_64BYTE
const float to_linear_float_table[256] = { 0, 0.000304f, 0.000607f, 0.000911f, const float to_linear_float_table[256] = { 0, 0.000304f, 0.000607f, 0.000911f,
0.001214f, 0.001518f, 0.001821f, 0.002125f, 0.002428f, 0.002732f, 0.003035f, 0.001214f, 0.001518f, 0.001821f, 0.002125f, 0.002428f, 0.002732f, 0.003035f,
0.003347f, 0.003677f, 0.004025f, 0.004391f, 0.004777f, 0.005182f, 0.005605f, 0.003347f, 0.003677f, 0.004025f, 0.004391f, 0.004777f, 0.005182f, 0.005605f,

View File

@ -22,9 +22,9 @@
// The below functions can encode and decode sRGB colors in various // The below functions can encode and decode sRGB colors in various
// representations. Some of them are implemented using look-up tables, // representations. Some of them are implemented using look-up tables,
// some others using SSE2 intrinsics. // some others using SSE2 intrinsics.
extern EXPCL_PANDA_PNMIMAGE ALIGN_64BYTE const unsigned char to_srgb8_table[256]; extern EXPCL_PANDA_PNMIMAGE const unsigned char to_srgb8_table[256];
extern EXPCL_PANDA_PNMIMAGE ALIGN_64BYTE const unsigned char to_linear_uchar_table[256]; extern EXPCL_PANDA_PNMIMAGE const unsigned char to_linear_uchar_table[256];
extern EXPCL_PANDA_PNMIMAGE ALIGN_64BYTE const float to_linear_float_table[256]; extern EXPCL_PANDA_PNMIMAGE const float to_linear_float_table[256];
EXPCL_PANDA_PNMIMAGE INLINE float decode_sRGB_float(unsigned char val); EXPCL_PANDA_PNMIMAGE INLINE float decode_sRGB_float(unsigned char val);
EXPCL_PANDA_PNMIMAGE INLINE float decode_sRGB_float(float val); EXPCL_PANDA_PNMIMAGE INLINE float decode_sRGB_float(float val);