Mercurial > hg
comparison mercurial/util.h @ 24443:539b3c7eea44
phase: compute phases in C
Previously, the phase computation would grow much slower as the oldest draft
commit in the repository grew older (which is very common in repos with evolve
on) and the number of commits increase.
By rewriting the computation in C we can speed it up from 700ms to 7ms on
a large repository whose oldest draft commit is a year old.
author | Laurent Charignon <lcharignon@fb.com> |
---|---|
date | Tue, 24 Mar 2015 11:00:09 -0700 |
parents | 98042b0e19f9 |
children | 1c533e23ce95 |
comparison
equal
deleted
inserted
replaced
24442:98042b0e19f9 | 24443:539b3c7eea44 |
---|---|
207 } | 207 } |
208 memcpy(&ret, &t, sizeof(t)); | 208 memcpy(&ret, &t, sizeof(t)); |
209 return ret; | 209 return ret; |
210 } | 210 } |
211 | 211 |
212 #define MIN(a, b) (((a)<(b))?(a):(b)) | |
212 /* VC9 doesn't include bool and lacks stdbool.h based on my searching */ | 213 /* VC9 doesn't include bool and lacks stdbool.h based on my searching */ |
213 #ifdef _MSC_VER | 214 #ifdef _MSC_VER |
214 #define true 1 | 215 #define true 1 |
215 #define false 0 | 216 #define false 0 |
216 typedef unsigned char bool; | 217 typedef unsigned char bool; |