in reply to Performance revision needed

Many of these suggestions are good, but they are all micro-optimizations. I suspect that your problem is that you are using a lot of memory. Try commenting out the lines that save the data, specifically,
$Hash{$mth}{$port}++; # and especially: push @Data, [@entry];
Then run it and see how fast it is. If it is fast, then you should look into getting rid of @Data and maybe $Hash. It may be that $Hash isn't that large--it's hard to tell from your code. (Also, don't you want to edit $port before you increment $Hash{$mth}{$port}?)

The easiest thing to do is probably write ($Time, $mth, $val, $value) out to a new file and process that in a second pass just as you now process @Data. Or, possibly, you can do it in one pass and not save the data at all.