Improve code builder for parallel builds (up to 4 times faster than before)

This commit is contained in:
Ivan Kravets
2015-12-04 21:06:29 +02:00
parent a8ae5e4d03
commit f4f65e4c84
3 changed files with 11 additions and 1 deletions

View File

@ -7,6 +7,7 @@ PlatformIO 2.0
2.5.0 (2015-12-??)
~~~~~~~~~~~~~~~~~~
* Improved code builder for parallel builds (up to 4 times faster than before)
* Generate `.travis.yml <http://docs.platformio.org/en/latest/ci/travis.html>`__
CI config for embedded projects by default
(`issue #354 <https://github.com/platformio/platformio/issues/354>`_)

View File

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
VERSION = (2, 5, "0.dev0")
VERSION = (2, 5, "0.dev1")
__version__ = ".".join([str(s) for s in VERSION])
__title__ = "platformio"

View File

@ -15,6 +15,7 @@
import os
import re
from imp import load_source
from multiprocessing import cpu_count
from os.path import isdir, isfile, join
import click
@ -389,6 +390,8 @@ class BasePlatform(object):
[
"scons",
"-Q",
"-j %d" % self.get_job_nums(),
"--warn=no-no-parallel-support",
"-f", join(util.get_source_dir(), "builder", "main.py")
] + variables + targets,
stdout=util.AsyncPipe(self.on_run_out),
@ -432,3 +435,9 @@ class BasePlatform(object):
self._last_echo_line = line
click.secho(line, fg=fg, err=level < 3)
def get_job_nums(self):
try:
return cpu_count()
except NotImplementedError:
return 1