mirror of
https://github.com/boostorg/build.git
synced 2026-02-14 00:32:11 +00:00
Variety of performance improvements.
* bjam; bump to version 3.1.12 * bjam; make it possible to build in MinGW/MSYS shell * bjam; move profile code to debug.h/c to make it available for use everywhere * bjam; cache all filesystem query operations, Unix and Windows only, include PWD and scanning * bjam; add memory profile info, and sprinkle throught code * bbv2; rewrite some while() loops into for() loops to reduce time and memory * bbv2; keep a single instance counter instead of one per type to reduce memory use * bjam+bbv2; change NORMALIZE_PATH builtin to join path parts to reduce memory use [SVN r31177]
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
#include "../strings.h"
|
||||
#include "../newstr.h"
|
||||
#include "../variable.h"
|
||||
#include "../debug.h"
|
||||
|
||||
|
||||
/* Use quite klugy approach: when we add order dependency from 'a' to 'b',
|
||||
@@ -62,6 +63,8 @@ void topological_sort(int** graph, int num_vertices, int* result)
|
||||
{
|
||||
int i;
|
||||
int* colors = (int*)calloc(num_vertices, sizeof(int));
|
||||
if ( DEBUG_PROFILE )
|
||||
profile_memory( num_vertices*sizeof(int) );
|
||||
for (i = 0; i < num_vertices; ++i)
|
||||
colors[i] = white;
|
||||
|
||||
@@ -86,6 +89,8 @@ LIST *order( PARSE *parse, FRAME *frame )
|
||||
int length = list_length(arg);
|
||||
int** graph = (int**)calloc(length, sizeof(int*));
|
||||
int* order = (int*)malloc((length+1)*sizeof(int));
|
||||
if ( DEBUG_PROFILE )
|
||||
profile_memory( length*sizeof(int*) + (length+1)*sizeof(int) );
|
||||
|
||||
for(tmp = arg, src = 0; tmp; tmp = tmp->next, ++src) {
|
||||
/* For all object this one depend upon, add elements
|
||||
@@ -94,6 +99,8 @@ LIST *order( PARSE *parse, FRAME *frame )
|
||||
int index = 0;
|
||||
|
||||
graph[src] = (int*)calloc(list_length(dependencies)+1, sizeof(int));
|
||||
if ( DEBUG_PROFILE )
|
||||
profile_memory( (list_length(dependencies)+1)*sizeof(int) );
|
||||
for(; dependencies; dependencies = dependencies->next) {
|
||||
int dst = list_index(arg, dependencies->string);
|
||||
if (dst != -1)
|
||||
|
||||
Reference in New Issue
Block a user