@@ -22,7 +22,7 @@ using namespace kanzi;
2222
2323
2424const int DivSufSort::SS_INSERTIONSORT_THRESHOLD = 16 ;
25- const int DivSufSort::SS_BLOCKSIZE = 4096 ;
25+ const int DivSufSort::SS_BLOCKSIZE = 8192 ;
2626const int DivSufSort::SS_MISORT_STACKSIZE = 16 ;
2727const int DivSufSort::SS_SMERGE_STACKSIZE = 32 ;
2828const int DivSufSort::TR_STACKSIZE = 64 ;
@@ -486,9 +486,7 @@ void DivSufSort::ssSort(const int pa, int first, int last, int buf, int bufSize,
486486 limit = ssIsqrt (last - first);
487487
488488 if (bufSize < limit) {
489- if (limit > SS_BLOCKSIZE)
490- limit = SS_BLOCKSIZE;
491-
489+ limit = limit > SS_BLOCKSIZE ? SS_BLOCKSIZE : limit;
492490 middle = last - limit;
493491 buf = middle;
494492 bufSize = limit;
@@ -554,7 +552,6 @@ void DivSufSort::ssSort(const int pa, int first, int last, int buf, int bufSize,
554552
555553int DivSufSort::ssCompare (int pa, int pb, int p2, const int depth) const
556554{
557- prefetchRead (&_sa[p2]);
558555 int u1 = depth + pa;
559556 int u2 = depth + _sa[p2];
560557 const int u1n = pb + 2 ;
@@ -579,8 +576,6 @@ int DivSufSort::ssCompare(int pa, int pb, int p2, const int depth) const
579576
580577int DivSufSort::ssCompare (const int sa1[], const int sa2[], const int depth) const
581578{
582- prefetchRead (&sa1[0 ]);
583- prefetchRead (&sa2[2 ]);
584579 int u1 = depth + sa1[0 ];
585580 int u2 = depth + sa2[0 ];
586581 const int u1n = sa1[1 ] + 2 ;
@@ -1103,9 +1098,7 @@ void DivSufSort::ssInsertionSort(const int pa, int first, int last, int depth)
11031098 break ;
11041099 }
11051100
1106- if (r == 0 )
1107- _sa[j] = ~_sa[j];
1108-
1101+ _sa[j] = r == 0 ? ~_sa[j] : _sa[j];
11091102 _sa[j - 1 ] = t - pa;
11101103 }
11111104}
0 commit comments