File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515 depth : 10
1616
1717before_script :
18- - chmod +x benches-compare.sh
18+ - if [ "$TRAVIS_RUST_VERSION" == "nightly" ]; then chmod +x benches-compare.sh; fi
1919
2020script :
2121 - cargo build --verbose --all --features "dot"
@@ -28,4 +28,4 @@ script:
2828 fi
2929
3030after_script :
31- - ./benches-compare.sh
31+ - if [ "$TRAVIS_RUST_VERSION" == "nightly" ]; ./benches-compare.sh; fi
Original file line number Diff line number Diff line change @@ -1073,6 +1073,44 @@ fn bench_others(c: &mut Criterion) {
10731073 }
10741074 } )
10751075 } ) ;
1076+ c. bench_function ( "add_edge_cycle_check_10" , |b| {
1077+ let mut graph: Graph < usize > = Graph :: new ( ) ;
1078+ b. iter ( || {
1079+ let mut v1 = graph. add_vertex ( 0 ) ;
1080+
1081+ for i in 1 ..=10 {
1082+ let v2 = graph. add_vertex ( i) ;
1083+ graph. add_edge_check_cycle ( & v1, & v2) ;
1084+ v1 = v2. clone ( ) ;
1085+ }
1086+ } )
1087+ } ) ;
1088+
1089+ c. bench_function ( "add_edge_cycle_check_100" , |b| {
1090+ let mut graph: Graph < usize > = Graph :: new ( ) ;
1091+ b. iter ( || {
1092+ let mut v1 = graph. add_vertex ( 0 ) ;
1093+
1094+ for i in 1 ..=100 {
1095+ let v2 = graph. add_vertex ( i) ;
1096+ graph. add_edge_check_cycle ( & v1, & v2) ;
1097+ v1 = v2. clone ( ) ;
1098+ }
1099+ } )
1100+ } ) ;
1101+ #[ cfg( feature = "sbench" ) ]
1102+ c. bench_function ( "add_edge_cycle_check_m" , |b| {
1103+ let mut graph: Graph < usize > = Graph :: new ( ) ;
1104+ b. iter ( || {
1105+ let mut v1 = graph. add_vertex ( 0 ) ;
1106+
1107+ for i in 1 ..=10_000_000 {
1108+ let v2 = graph. add_vertex ( i) ;
1109+ graph. add_edge_check_cycle ( & v1, & v2) ;
1110+ v1 = v2. clone ( ) ;
1111+ }
1112+ } )
1113+ } ) ;
10761114 c. bench_function ( "add_vertex_10" , |b| {
10771115 let mut graph: Graph < usize > = Graph :: new ( ) ;
10781116 b. iter ( || {
You can’t perform that action at this time.
0 commit comments