Commit Graph
100 Commits
Author SHA1 Message Date
Marek Lemańczyk a1187a06a4 RecyclableList.AddRange(List<T> items) performance improvements 2023-03-11 17:12:31 +01:00
Marek Lemańczyk 8dfdc6f088 Removed unnecessary Span<T> creation in RecyclableList.AddRange(T[] items) & .AddRange(RecyclableArrayList<T> items) 2023-03-11 16:43:14 +01:00
Marek Lemańczyk 1d61684300 RecyclableList.AddRange(RecyclableArrayList<T> items) performance improvements & simplification. 2023-03-11 16:00:59 +01:00
Marek Lemańczyk e7e670ae35 RecyclableList.AddRange(T[] items) performance improvements. 2023-03-11 15:51:52 +01:00
Marek Lemańczyk f76276c7a4 RecyclableArrayList.CopyTo fixed to copy only the no. of items added to the list. 2023-03-11 15:26:39 +01:00
Marek Lemańczyk 9c640f4251 RecyclableList.AddRange(List<T> items) performance improvements. 2023-03-10 18:30:41 +01:00
Marek Lemańczyk 948bbaff5c New benchmarks added 2023-03-10 17:10:19 +01:00
Marek Lemańczyk 41ad48d4e6 New benchmarks addedo 2023-03-10 17:09:53 +01:00
Marek Lemańczyk 3ce3becfbd RecyclableList performance improvements & fixes. New tests added. 2023-03-10 16:52:36 +01:00
Marek Lemańczyk 02138dfac6 New tests added for IndexOf & LongIndexOf 2023-03-05 19:19:54 +01:00
Marek Lemańczyk 0cd68fbb7c New benchmark cases added 2023-03-05 19:02:37 +01:00
Marek Lemańczyk a15f2431fc Tabs fixed. New benchmark params added 2023-03-05 19:01:53 +01:00
Marek Lemańczyk 73e07c917d RecyclableList_LongIndexOf_FirstItems & RecyclableList_LongIndexOf_LastItems benchmarks added 2023-03-05 18:55:23 +01:00
Marek Lemańczyk ba17f6972f RecyclableList_IndexOf_FirstItems, RecyclableList_IndexOf_LastItems, List_IndexOf_FirstItems & List_IndexOf_LastItems benchmarks fixed to always search for some items, if the no. of test cases is low. 2023-03-05 18:54:33 +01:00
Marek Lemańczyk 2558f57934 RecyclableList.Remove modified to allow removing the last item. 2023-03-05 18:51:06 +01:00
Marek Lemańczyk ec355160f9 IndexOf & LongIndexOf made alike. Small refactoring. 2023-03-05 18:50:09 +01:00
Marek Lemańczyk a50ef10989 RecyclableList.IndexOf performance improvements. 2023-03-05 14:33:43 +01:00
Marek Lemańczyk 9676ee7485 Performance improvement for low no. of items 2023-03-03 01:33:41 +01:00
Marek Lemańczyk be9dfaf43a Code cleanup. Unnecessary versions removed. 2023-03-03 01:31:14 +01:00
Marek Lemańczyk 3552dd00d1 Test object count increased to 100_000 to better cover cases. 2023-03-01 23:09:48 +01:00
Marek Lemańczyk bbbc47bd42 BenchmarkBase.BlockSize parameterized. 2023-03-01 00:45:28 +01:00
Marek Lemańczyk 4ea8e20f0a Compilation error fix when using manual benchmark execution. Additional benchmark method added. 2023-03-01 00:44:08 +01:00
Marek Lemańczyk 692891cca9 Pass block size when creating RecyclableList. 2023-03-01 00:42:38 +01:00
Marek Lemańczyk f38ee0d498 Contains benchmarks will now always search for 10% of the test objects count. 2023-03-01 00:41:16 +01:00
Marek Lemańczyk 573e387a75 RecyclableList.Contains performance improvement +1%. Other versions kept for reference, if needed. Pending cleanup. 2023-03-01 00:25:06 +01:00
Marek Lemańczyk 5d9526a9f9 Fixed _lastBlockIndex assignment. 2023-03-01 00:22:27 +01:00
Marek Lemańczyk 59defd435c Benchmarks improved. Contains & IndexOf separated into 2 groups: first 1 000 items & last 1 000 items. 2023-02-05 22:58:48 +01:00
Marek Lemańczyk 743e88f0e6 RecyclableList.Contains & .IndexOf fixed. Tests modified to validate operations on multiple blocks. 2023-02-05 19:49:28 +01:00
Marek Lemańczyk f00849614f RecyclableList.IndexOf reworked for performance improvement. 2023-02-05 18:59:34 +01:00
Marek Lemańczyk 10ae744875 RecyclableList.Contains reworked for performance improvements. 69% vs List.Contains 2023-02-05 17:58:29 +01:00
mlemanczyk 91abf1a614 RecyclableList.Contains reworked - first version 2023-02-01 23:29:23 +01:00
mlemanczyk f3381942bc Tiny code standardization 2023-01-31 20:24:30 +01:00
mlemanczyk 2dc6d74b0b Fix to use the new _blockSize when we add capacity 2023-01-31 20:23:28 +01:00
mlemanczyk 55dc1459c7 Incorrect indexes fixed. 2023-01-31 20:22:04 +01:00
mlemanczyk 30c9a6cedc RecyclableListExtensions.CopyTo fixed 2023-01-31 02:21:42 +01:00
mlemanczyk 2be660e7f0 Merge branch 'recyclable-block-list-added' of https://github.com/mlemanczyk/Recyclable.Collections into recyclable-block-list-added 2023-01-29 21:39:19 +01:00
mlemanczyk c923383a71 Tiny code readability improvement 2023-01-29 21:39:16 +01:00
mlemanczyk 32fcc1ad04 Tiny code readability improvement 2023-01-29 21:36:30 +01:00
mlemanczyk 85fcf69c75 Local int vars converted to stackalloc'ed array for performance measures. Recyclable.Add benchmarks yield 0.42 - 0.45 vs List.Add 2023-01-29 21:34:14 +01:00
mlemanczyk 7f90fcc969 Tiny cleanup & readability improvement 2023-01-29 21:32:04 +01:00
mlemanczyk b24adc6d93 Unnecessary local var removed. 2023-01-29 21:31:25 +01:00
mlemanczyk 650a63828f Unnecessary _capacity assignment removed. It's already set by RecyclableList.Clear. 2023-01-29 21:30:15 +01:00
mlemanczyk d07c77c906 Unnecessary field initializer removed 2023-01-29 21:29:11 +01:00
mlemanczyk 4f920cf89a RecyclableList.Count redirected to _longCount for better performance 2023-01-29 21:26:22 +01:00
mlemanczyk 71544f8a47 Finished RecyclableList implementation of array pool overriding. 2023-01-29 18:05:27 +01:00
mlemanczyk 76b03345a4 Merge branch 'recyclable-block-list-added' of https://github.com/mlemanczyk/Recyclable.Collections into recyclable-block-list-added 2023-01-29 18:04:34 +01:00
mlemanczyk ea29108731 Code cleanup - renaming blockSize => minBlockSize to better reflect the use. 2023-01-29 18:04:25 +01:00
mlemanczyk 463ad3a365 Code cleanup - renaming blockSize => minBlockSize to better reflect the use. 2023-01-29 14:50:47 +01:00
mlemanczyk b01dc63165 Too early typecasting fixed. 2023-01-29 14:50:00 +01:00
mlemanczyk 326999c682 Performance improvement - reuse local var 2023-01-29 14:48:30 +01:00
mlemanczyk a3335bf4e7 IF's inverted to match expected most frequent scenarios. 2023-01-29 14:20:59 +01:00
mlemanczyk 6270f79291 Switches converted back to IFs. They are IF's in IL anyway. 2023-01-29 14:19:59 +01:00
mlemanczyk 16acdff58a Code readability - newArraySpan renamed => newMemoryBlocksSpan to match naming convention 2023-01-29 14:13:31 +01:00
mlemanczyk a9012dc25d Tiny cleanup. Declaration moved closer to usage. 2023-01-29 14:09:41 +01:00
mlemanczyk 96f4912cd3 Unnecessary case removed. 2023-01-29 14:07:34 +01:00
mlemanczyk 604ee06697 Merge branch 'recyclable-block-list-added' of https://github.com/mlemanczyk/Recyclable.Collections into recyclable-block-list-added 2023-01-28 23:54:55 +01:00
mlemanczyk 1b3c24bf74 Performance improvement - removed unneeded case. We never hit it in our benchmarks or tests. We'll use Memory<T> instead of Span<T> again, where applicable. 2023-01-28 23:54:53 +01:00
mlemanczyk 8b7c4407d5 Performance improvement - removed unneeded case. We never hit it in our benchmarks or tests. 2023-01-28 23:48:28 +01:00
mlemanczyk 06ef3d4fa4 Tiny cleanup 2023-01-28 23:19:26 +01:00
mlemanczyk ea1d7d91ba Solutions from RecyclableList.SetNewLength migrated to RecyclableList.SetNewLength. 2023-01-28 23:17:30 +01:00
mlemanczyk 3cfe0b7e79 We'll now use Span<T> instead of memory to eliminate 1 more local var. 2023-01-28 23:04:55 +01:00
mlemanczyk 3d6536beea RecyclableList.Add marked for aggressive inlining for the best performance 2023-01-28 22:49:10 +01:00
mlemanczyk 6da67ede0d RecyclableArrayList.Add marked for aggresive inlining for the best performance. 2023-01-28 22:40:48 +01:00
mlemanczyk 315acb5a68 Fixing condition for taking array from the pool 2023-01-28 15:02:50 +01:00
mlemanczyk 3ce5c52d54 Adjusting default block size to what .Net currently returns to avoid sub-optimal execution paths. 2023-01-28 14:32:19 +01:00
mlemanczyk 41c9eccd81 Adjusting const to ^2 2023-01-28 14:28:51 +01:00
mlemanczyk d545d31aea Merge branch 'recyclable-block-list-added' of https://github.com/mlemanczyk/Recyclable.Collections into recyclable-block-list-added 2023-01-28 14:19:56 +01:00
mlemanczyk c72b18ad1d Source code cleanup 2023-01-28 14:19:50 +01:00
mlemanczyk 10717c4bd4 Source code cleanup 2023-01-28 14:19:31 +01:00
mlemanczyk 680776f259 Performance improvement - Removing unneeded check. There is no case the new block count == current block count. 2023-01-28 14:18:34 +01:00
mlemanczyk 35ccb12efc Performance improvements 2023-01-28 14:05:30 +01:00
mlemanczyk b9b4c40cf9 Performance improvement. Removing unnecessary var. 2023-01-27 23:48:56 +01:00
mlemanczyk d4440134c8 ref removed. I seem to get better & more stable benchmarks without it. 2023-01-27 23:32:28 +01:00
mlemanczyk 4fcf3f2362 public MemoryBlocks property added to allow more efficient use. 2023-01-27 22:33:14 +01:00
mlemanczyk c283cb562c Read.me extended & updated. 2023-01-27 22:31:42 +01:00
mlemanczyk f9b2d82629 RecyclableList.Clear, .RemoveAt, .RemoveBlock, .SetNewLength, Dispose performance improvements. 2023-01-25 22:48:37 +01:00
mlemanczyk 032908bc7d _lastBlockIndex & _lastItemIndex fields added for performance gain. Tiny cleanup. 2023-01-24 22:41:43 +01:00
mlemanczyk 9db490d8e9 Fixed problem with RecyclableList.RemoveAt returning to the pool always the same block 2023-01-24 02:10:26 +01:00
mlemanczyk 43c2c6f13a if converted to switch for performance improvements. 2023-01-23 01:40:11 +01:00
mlemanczyk f45b6aac98 RecyclableList performance optimizations. 2023-01-23 01:22:41 +01:00
mlemanczyk 30dfd97336 ReleaseBlock method removed. 2023-01-23 00:16:02 +01:00
mlemanczyk 64be78d1c6 Benchmark list updated for current runs. 2023-01-23 00:15:25 +01:00
mlemanczyk cbac777e43 Using cleanup 2023-01-22 23:46:20 +01:00
mlemanczyk 1691f07fbe RecyclableList.AddRange will only call EnsureCapacity, if there is a need for it. Small source code cleanup. 2023-01-22 23:45:54 +01:00
mlemanczyk 7aec77e674 Recyclable list initializations fixed to pass the no. of items, not block size. 2023-01-22 23:17:02 +01:00
mlemanczyk f94e91c45d RecyclableList.AddRange(IEnumerable) made similar in behavior / optimizations to RecyclableArrayList. Variables named made similar. 2023-01-22 23:16:21 +01:00
mlemanczyk 7c78b6f87e RecyclableArrayList variables names standardized a little with RecyclableList. 2023-01-22 23:13:00 +01:00
mlemanczyk 576ac9ccfa RecyclableList.RemoveBlock renamed to ReleaseBlock.
RecyclableList.Clear will no longer create new arrays. It will only release the array to the pool & decrease capacity.

Fixed possibly infinite loop in Clear.
2023-01-22 01:06:21 +01:00
mlemanczyk b3380b1f35 Small cleanup. RecyclableCollectionsBenchmarks properties & fields moved to RecyclableCollectionsBenchmark.cs file. 2023-01-21 20:02:00 +01:00
mlemanczyk 6ef79d2203 Solutions from RecyclableArreyList were copied to RecylableList. Initial version. 2023-01-21 18:50:21 +01:00
mlemanczyk 0c3847a9bf Fixing startup issue 2023-01-16 22:58:12 +01:00
mlemanczyk f3198a45a4 Smaller improvements and additional benchmarks setup 2023-01-16 22:56:13 +01:00
mlemanczyk bc4f0576de RecyclableArrayList parameterless constructor benchmarks added 2023-01-16 22:55:47 +01:00
mlemanczyk 4d1c59f672 Redundand benchmarks removed. 2023-01-16 22:03:40 +01:00
mlemanczyk cc364c5fd7 Create benchmarks updated. Global benchmark setup & cleanup added. 2023-01-16 22:00:45 +01:00
mlemanczyk 4bfb40007a Missing IList<T> interface added. Tiny cleanup. 2023-01-15 20:19:01 +01:00
mlemanczyk 8067bfb542 Tiny cleanup 2023-01-15 20:13:49 +01:00
mlemanczyk f500f846ac RecyclableArrayList.AddRange(IEnumerable<T>) performance improvements. ...WhenSourceIsIEnumerable benchmarks reworked to use real IEnumerable, which can't be typecasted to anything. 2023-01-15 20:12:52 +01:00
mlemanczyk bf2d966f28 RecyclableArrayList[int index] set performance improvement. Add marked for aggresive inlining. 2023-01-15 17:49:18 +01:00
mlemanczyk 63773415e7 Merge branch 'recyclable-block-list-added' of https://github.com/mlemanczyk/Recyclable.Collections into recyclable-block-list-added 2023-01-15 12:24:05 +01:00