Re: [PATCH v4] Btrfs: optimize key searches in btrfs_search_slot

2013-08-30 Thread David Sterba
On Thu, Aug 29, 2013 at 08:21:51PM +0100, Filipe David Borba Manana wrote: Count: 5013 Range: 25.000 - 497.000; Mean: 82.767; Median: 64.000; Stddev: 49.972 Percentiles: 90th: 141.000; 95th: 182.000; 99th: 287.000 25.000 - 33.930: 211 ## 33.930 - 45.927: 277

Re: [PATCH v4] Btrfs: optimize key searches in btrfs_search_slot

2013-08-30 Thread Filipe David Manana
On Fri, Aug 30, 2013 at 3:14 PM, David Sterba dste...@suse.cz wrote: On Thu, Aug 29, 2013 at 08:21:51PM +0100, Filipe David Borba Manana wrote: Count: 5013 Range: 25.000 - 497.000; Mean: 82.767; Median: 64.000; Stddev: 49.972 Percentiles: 90th: 141.000; 95th: 182.000; 99th: 287.000 25.000

Re: [PATCH v4] Btrfs: optimize key searches in btrfs_search_slot

2013-08-30 Thread Filipe David Manana
On Fri, Aug 30, 2013 at 3:59 PM, David Sterba dste...@suse.cz wrote: On Fri, Aug 30, 2013 at 03:47:21PM +0100, Filipe David Manana wrote: Sure. They're actually better now :) Thanks. The numbers changed in both samples, but the relative difference is still 2x improvement in this particular

Re: [PATCH v4] Btrfs: optimize key searches in btrfs_search_slot

2013-08-30 Thread David Sterba
On Fri, Aug 30, 2013 at 03:47:21PM +0100, Filipe David Manana wrote: Sure. They're actually better now :) Thanks. The numbers changed in both samples, but the relative difference is still 2x improvement in this particular test. david -- To unsubscribe from this list: send the line unsubscribe

[PATCH v4] Btrfs: optimize key searches in btrfs_search_slot

2013-08-29 Thread Filipe David Borba Manana
When the binary search returns 0 (exact match), the target key will necessarily be at slot 0 of all nodes below the current one, so in this case the binary search is not needed because it will always return 0, and we waste time doing it, holding node locks for longer than necessary, etc. Below