Efficiently find Unique triplets of three char vectors in MATLAB

To mimic the larger set of data in the question, I created the following randomized character arrays using randi:

a = char(randi([65 90], [100 76]));      % Generate 100 76-character arrays
a = a(randi([1 100], [11724952 1]), :);  % Replicate rows: 11724952-by-76 result
b = char(randi([65 90], [100 64]));      % Generate 100 64-character arrays
b = b(randi([1 100], [11724952 1]), :);  % Replicate rows: 11724952-by-64 result
c = char(randi([65 90], [100 6]));       % Generate 100 6-character arrays
c = c(randi([1 100], [11724952 1]), :);  % Replicate rows: 11724952-by-6 result

With up to 100 unique strings in each of a, b, and c, this will yield close to 1,000,000 unique combinations when concatenated.

I then tested 3 solutions: the original using unique, a variant that converts the character array to a cell array of strings using cellstr to avoid using the 'rows' argument, and one using a containers.Map object. The last one feeds the strings as keys to the containers.Map class (with dummy associated values) and lets it create a map that will have only the unique strings as its keys, which you can then extract.

Since these tests took a minimum of 1 minute to run, it wasn't feasible to use the more accurate timing routine timeit (which runs the function many times over to get an average measurement). I therefore used tic/toc. Here are some typical results using version R2018a:

>> clear d
>> tic; d = unique(horzcat(a, b, c), 'rows'); toc
Elapsed time is 726.324408 seconds.

>> clear d
>> tic; d = unique(cellstr([a b c])); toc
Elapsed time is 99.312927 seconds.

>> clear d
>> tic; map = containers.Map(cellstr([a b c]), ones(size(a, 1), 1)); d = map.keys.'; toc
Elapsed time is 89.853430 seconds.

The two faster solutions typically averaged around the same, with the containers.Map being slightly faster on average. They are both much faster than using unique with the 'rows' argument, although this is in disagreement with the results in the post using version R2018b. Maybe unique had significant updates in the newer version, or maybe the specific content of the character arrays matters greatly (e.g. whether all strings repeat with roughly equal frequency, if the arrays are sorted versus unsorted, etc.).