Skip to content

Commit

Permalink
Resolved issue with parallel delete.
Browse files Browse the repository at this point in the history
  • Loading branch information
NTDLS committed Oct 7, 2024
1 parent 5142458 commit 04ce02c
Show file tree
Hide file tree
Showing 4 changed files with 510 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -999,7 +999,7 @@ private void RemoveDocumentsFromIndex(Transaction transaction, PhysicalSchema ph
{
try
{
var childPool = _core.ThreadPool.Indexing.CreateChildPool(_core.Settings.IndexingChildThreadPoolQueueDepth);
var childPool = _core.ThreadPool.Indexing.CreateChildPool<uint>(_core.Settings.IndexingChildThreadPoolQueueDepth);

for (uint indexPartition = 0; indexPartition < physicalIndex.Partitions; indexPartition++)
{
Expand All @@ -1009,7 +1009,7 @@ private void RemoveDocumentsFromIndex(Transaction transaction, PhysicalSchema ph
}

var ptThreadQueue = transaction.Instrumentation.CreateToken(PerformanceCounter.ThreadQueue);
childPool.Enqueue(() =>
childPool.Enqueue(indexPartition, (uint indexPartition) =>
{
#region Thread.

Expand Down
14 changes: 10 additions & 4 deletions NTDLS.Katzebase.Management/StaticAnalysis/StaticAnalyzer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,16 @@ static Action AddSyntaxError(TextDocument textDocument, TextMarkerService textMa
return;
}

var line = textDocument.GetLineByNumber(lineNumber.EnsureNotNull());
int startOffset = line.Offset;
int length = line.Length;
textMarkerService.Create(startOffset, length, message, Colors.Red);
try
{
var line = textDocument.GetLineByNumber(lineNumber.EnsureNotNull());
int startOffset = line.Offset;
int length = line.Length;
textMarkerService.Create(startOffset, length, message, Colors.Red);
}
catch (Exception ex)
{
}
};
}
}
Expand Down
26 changes: 26 additions & 0 deletions TestApplications/Benchmark/PayloadModel.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
namespace Benchmark
{
internal class PayloadModel
{
public int Id { get; set; }
public int AcceptedAnswerId { get; set; }
public int AnswerCount { get; set; }
public string? Body { get; set; }
public DateTime? ClosedDate { get; set; }
public int CommentCount { get; set; }
public DateTime? CommunityOwnedDate { get; set; }
public DateTime? CreationDate { get; set; }
public int FavoriteCount { get; set; }
public DateTime? LastActivityDate { get; set; }
public DateTime? LastEditDate { get; set; }
public string? LastEditorDisplayName { get; set; }
public int LastEditorUserId { get; set; }
public int OwnerUserId { get; set; }
public int ParentId { get; set; }
public int PostTypeId { get; set; }
public int Score { get; set; }
public string? Tags { get; set; }
public string? Title { get; set; }
public int ViewCount { get; set; }
}
}
Loading

0 comments on commit 04ce02c

Please sign in to comment.