Updated GetNextIdValue to get actual next Id#13
Updated GetNextIdValue to get actual next Id#13qpooqp wants to merge 1 commit intottu:masterfrom qpooqp:master
Conversation
|
Would you like to add a benchmark that adds e.g. 1k, 10k, 100k etc. items to collection? With that we could compare how much this will slow down inserting new items. I can't see any other solution for this so if this slows down insert a lot, maybe we have to add some limit e.g. for collections under 1000 items we go through all items and for over 1000 items just take last item's id. |
|
I tried to make some benchmarks, but the performance was worse than i thought. 😄 I made some improvements, but i need to polish it a little bit. Give me some time and i will commit the code. |
|
There is some ugly solutions to try e.g.
Not sure if these will be any faster. DocumentCollection could have latest id value stored in a variable. Should be lazy so won't be calculated unless needed. This should improve performance. |
|
Interesting idea to store the latest ID in variable. I will try to use this approach. |
|
Hello. I just want to give you some update. I'm quite far, but still struggling with some cases. Main problem is when there is string ID. I can't easily compare it and when it gets mixed up with int IDs then it causes problems too. |
Potential fix for issue #3.
I'm taking all id values and then picking the max value from them.