If you give an example t, f and g it might make it easier to help you, but as a start you should look at vectorising your functions so that they work on columns instead of iterating through every row of the table.
without knowing anything more about what you’re trying to do in g, a quick win (if you have enough memory) is to ensure t is a global, take it out of the f function and peach through t.
g peach t
you don’t want to have t as a parameter in a peach esp if if t is big, since memory rep would create a bottleneck.
$[row[
type]=
a
I really hope you’re not using a column called “type”, given type is a keyword. So I’m going to use Type.
Also, there’s no need for complicated nested if statements when you can simply use the where clause.
select val2+val1*s from t where Type=`a
If Type can only ever have two values, you can use vector conditional:
http://code.kx.com/wiki/Reference/QuestionSymbol#vector_conditional
Are you just trying to find the area under a curve with calc/eqn1?
@manish
in calc, i am trying to find root of eqaution “eqn[x;y;z]-val1” if possible in range [0,2]
Thanks Guys , after making it global performance really improved and also saved lots of memory
But cant we pass table as refernce in function?
you could but it would still need to be a global