@ saturn7: I think, it was meant that reducing an Game.market.getAllOrders() to hashmap takes a long time, and it can't be saved into Memory due to huge size, and it will be used several time per one tick.
@ Dissi: I've found a pretty useful solution (see below). Not sure where exactly "global" object is stored at runtime under hood, but there are some statistics: ~1.0 cpu -- first call, ~0.01 cpu -- every subsequent calls.
global.orders = function() { if((global.__orders_update || 0) !== Game.time || !global.__orders) { global.__orders = _.reduce(Game.market.getAllOrders(), function(res, o) { res[o.id] = o; return res; },{}); global.__orders_update = Game.time; } return global.__orders;}