File tree Expand file tree Collapse file tree 4 files changed +16
-8
lines changed Expand file tree Collapse file tree 4 files changed +16
-8
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,8 @@ using pretty_asdl::doc;
41
41
using runtime_asdl ::cmd_value ;
42
42
using syntax_asdl ::command ;
43
43
using syntax_asdl ::expr ;
44
- using syntax_asdl ::printf_part ; // added when self._Percent() used it in function signature
44
+ using syntax_asdl ::printf_part ; // added when self._Percent() used it in
45
+ // function signature
45
46
using syntax_asdl ::proc_sig ;
46
47
using value_asdl ::sh_lvalue ; // for builtin_assign.py and builtin_misc.py
47
48
using value_asdl ::value ;
Original file line number Diff line number Diff line change 22
22
# Usage:
23
23
# demo/sparse-array.sh <function name>
24
24
25
+ TIMEFORMAT=' %U'
26
+
25
27
set -o nounset
26
28
set -o pipefail
27
29
set -o errexit
28
30
31
+ my-time () {
32
+ local tmp=/tmp/sparse-array
33
+ { time " $@ " ; } 2> $tmp
34
+ echo " $( cat $tmp ) seconds"
35
+ }
36
+
29
37
compare-x () {
30
38
local x=$1
31
39
@@ -35,13 +43,13 @@ compare-x() {
35
43
echo ===
36
44
echo $osh SparseArray
37
45
echo
38
- time sparse-$x $osh
46
+ my- time sparse-$x $osh
39
47
40
48
for sh in bash $osh ; do
41
49
echo ===
42
50
echo $sh
43
51
echo
44
- time $sh $0 $x
52
+ my- time $sh $0 $x
45
53
done
46
54
}
47
55
Original file line number Diff line number Diff line change @@ -233,7 +233,7 @@ void Dict<K, V>::reserve(int num_desired) {
233
233
values_ = NewSlab<V>(capacity_);
234
234
235
235
if (old_k != nullptr ) { // rehash if there were any entries
236
- // log("REHASH num_desired %d", num_desired);
236
+ // log("REHASH num_desired %d", num_desired);
237
237
len_ = 0 ;
238
238
for (int i = 0 ; i < old_len; ++i) {
239
239
set (old_k->items_ [i], old_v->items_ [i]);
Original file line number Diff line number Diff line change @@ -694,16 +694,16 @@ TEST hash_pileup_bug() {
694
694
std::unordered_map<unsigned , bool > hist;
695
695
696
696
for (int i = 0 ; i < 24 ; ++i) {
697
- mops::BigInt index {1 << i};
698
- log (" index %ld" , index);
697
+ mops::BigInt index{1 << i};
698
+ // log("index %ld", index);
699
699
700
700
for (mops::BigInt j = index; j < index + 2000 ; ++j) {
701
701
d->set (j, kEmptyString );
702
702
unsigned h = hash_key (j);
703
703
hist[h] = true ;
704
704
// log("%ld %d", j, h);
705
705
}
706
- log (" len %d" , len (d));
706
+ // log("len %d", len(d));
707
707
}
708
708
709
709
log (" len %d" , len (d));
@@ -712,7 +712,6 @@ TEST hash_pileup_bug() {
712
712
PASS ();
713
713
}
714
714
715
-
716
715
GREATEST_MAIN_DEFS ();
717
716
718
717
int main (int argc, char ** argv) {
You can’t perform that action at this time.
0 commit comments