I've been profiling the code and found that the call to sort-by is very expensive and is called with a high frequency. I believe this call can safely be moved up the call hierarchy from custom-indent to indent so that it is only called once per call to indent.
Evaluation count : 6 in 6 samples of 1 calls.
Execution time mean : 6.417959 sec
Execution time std-deviation : 49.024102 ms
Execution time lower quantile : 6.385542 sec ( 2.5%)
Execution time upper quantile : 6.499747 sec (97.5%)
Overhead used : 7.166550 ns
Found 1 outliers in 6 samples (16.6667 %)
low-severe 1 (16.6667 %)
Variance from outliers : 13.8889 % Variance is moderately inflated by outliers
After:
Evaluation count : 6 in 6 samples of 1 calls.
Execution time mean : 1.222197 sec
Execution time std-deviation : 107.052812 ms
Execution time lower quantile : 1.119392 sec ( 2.5%)
Execution time upper quantile : 1.350514 sec (97.5%)
Overhead used : 7.166550 ns
Evaluation count : 6 in 6 samples of 1 calls.
Execution time mean : 6.803126 sec
Execution time std-deviation : 110.233777 ms
Execution time lower quantile : 6.734209 sec ( 2.5%)
Execution time upper quantile : 6.983225 sec (97.5%)
Overhead used : 7.166550 ns
Found 1 outliers in 6 samples (16.6667 %)
low-severe 1 (16.6667 %)
Variance from outliers : 13.8889 % Variance is moderately inflated by outliers
After:
Evaluation count : 6 in 6 samples of 1 calls.
Execution time mean : 1.536204 sec
Execution time std-deviation : 145.444873 ms
Execution time lower quantile : 1.398777 sec ( 2.5%)
Execution time upper quantile : 1.692483 sec (97.5%)
Overhead used : 7.166550 ns
I've been profiling the code and found that the call to
sort-by
is very expensive and is called with a high frequency. I believe this call can safely be moved up the call hierarchy fromcustom-indent
toindent
so that it is only called once per call toindent
.Benchmark:
Before:
After:
Benchmark:
Before:
After: