File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 191191/test-mktemp
192192/test-parse-options
193193/test-path-utils
194+ /test-read-cache
194195/test-regex
195196/test-revision-walking
196197/test-run-command
Original file line number Diff line number Diff line change @@ -569,6 +569,7 @@ TEST_PROGRAMS_NEED_X += test-mergesort
569569TEST_PROGRAMS_NEED_X += test-mktemp
570570TEST_PROGRAMS_NEED_X += test-parse-options
571571TEST_PROGRAMS_NEED_X += test-path-utils
572+ TEST_PROGRAMS_NEED_X += test-read-cache
572573TEST_PROGRAMS_NEED_X += test-regex
573574TEST_PROGRAMS_NEED_X += test-revision-walking
574575TEST_PROGRAMS_NEED_X += test-run-command
Original file line number Diff line number Diff line change @@ -1520,8 +1520,9 @@ int discard_index(struct index_state *istate)
15201520 free_name_hash (istate );
15211521 cache_tree_free (& (istate -> cache_tree ));
15221522 istate -> initialized = 0 ;
1523-
1524- /* no need to throw away allocated active_cache */
1523+ free (istate -> cache );
1524+ istate -> cache = NULL ;
1525+ istate -> cache_alloc = 0 ;
15251526 return 0 ;
15261527}
15271528
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+
3+ test_description=" Tests performance of reading the index"
4+
5+ . ./perf-lib.sh
6+
7+ test_perf_default_repo
8+
9+ count=1000
10+ test_perf " read_cache/discard_cache $count times" "
11+ test-read-cache $count
12+ "
13+
14+ test_done
Original file line number Diff line number Diff line change 1+ #include "cache.h"
2+
3+ int main (int argc , char * * argv )
4+ {
5+ int i , cnt = 1 ;
6+ if (argc == 2 )
7+ cnt = strtol (argv [1 ], NULL , 0 );
8+ for (i = 0 ; i < cnt ; i ++ ) {
9+ read_cache ();
10+ discard_cache ();
11+ }
12+ return 0 ;
13+ }
You can’t perform that action at this time.
0 commit comments