Skip to content

Commit

Permalink
performance tweaks to fixconflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
ab9rf committed Aug 6, 2023
1 parent 5d7c18d commit dee10b4
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion ghidra/FixConflicts.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ protected void run() throws Exception {
String message = "Fixing " + String.valueOf(conflicts.size()) + " conflicts...";
println(message);
Instant start = Instant.now();
Instant lastSwing = Instant.now();
monitor.initialize(conflicts.size());
monitor.setMessage(message);
for (DataType dt : conflicts) {
Expand All @@ -69,7 +70,14 @@ protected void run() throws Exception {
}
dtm.replaceDataType(dt, good, false);
monitor.incrementProgress(1);
Swing.allowSwingToProcessEvents();

Duration swingElapsed = Duration.between(lastSwing, Instant.now());
if (swingElapsed.toMillis() > 1000)
{
Swing.allowSwingToProcessEvents();
lastSwing = Instant.now();
}

Duration elapsed = Duration.between(start, Instant.now());
if (elapsed.toMillis() > 60000)
{
Expand Down

0 comments on commit dee10b4

Please sign in to comment.