Perform a find on your subject field.
I tried that, it is so slow compared to a global that changed the portal filter,
It shouldn't be any slower and could well be faster.
You'll need to describe what you set up in more detail if you want to explore why performing a find is so slow.
Slow results from a find usually are due to specifiying criteria in an unstored or unindexed field. Specifying criteria in a field from a related table will also be slower, but not as dramatic a delay as when searching on a field that does not have an index.
Here is the original portal filter calc. How would this be written for a perform script trigger step?
Tests::SYS_id_ratings_category = Students::SYS_category_id__g
Students::SYS_category_id__g = "RCAT1007"
__g fields are globals
"contains" would appear to be a custom function. Am I correct that it returns True if the text in the second parameter is contained by the text in the first?
What kind of fields are: SYS_id_ratings_category? Is it indexed?
Are you finding records in Tests or Students?
What is the relationship specified for this filtered portal?
Contains function is not mine and there are no notes. If(PatternCount(s; ss) > 0; 1; 0)
The SYS_id_ratings_category fields are Text and Indexed
Searching for Tests of a Student
SYS_Tests_set_current = SYS_id_Tests_set
SYS_id = SYS_ID_Student
SYS_k_actual = type
The set is a grouping of Test over a period od time. The time period is not a consistent length.
What an unecessary custom function!
assuming that s is the first parameter and ss the second ( s = Tests::display__c; ss =Students::SYS_filter_display__g), you could just use Patterncount ( Tests::display__c; Students::SYS_filter_display__g ) and get exactly the same results!
How does this relationship match to a grouping "over a period of time"? I assume that SYS_Tests_set_current does that, but can imagine two different ways that might be done.
One Option that I can describe now is this scripted, two part query of the Tests table:
Go To Related Record [Show only related records; From table: Tests; Using layout: "Tests" (Tests)]
Enter Find Mode 
If [Students::SYS_category_id__g ≠ "RCAT1007"]
Set Field [tests::SYS_id_ratings_category ; Students::SYS_category_id__g ]
Set Field [Tests::display__c; "*" & Students::SYS_filter_display__g & "*" ]
Set Error Capture [on]
Constrain Found Set