cti-stix-elevator icon indicating copy to clipboard operation
cti-stix-elevator copied to clipboard

Should the elevator perform two passes?

Open rpiazza opened this issue 8 years ago • 2 comments

STIX 1.x allows "use" before "definition", in other words, using idrefs before the object has been defined and its id made available.

This causes much "post" processing to resolve idrefs once the content has been scanned.

Two pass processing might be more efficient

rpiazza avatar Apr 26 '17 18:04 rpiazza

You're effectively doing two-pass already, with the bulk of the work done in the first pass, but a non-trivial amount done in "post"-processing, correct? And you're suggesting doing a first pass which collects IDs and maps them to python-stix objects, and the bulk of that work once that mapping is created (since it is much easier to look up objects in that mapping)?

I think that's a good approach.

gtback avatar Apr 26 '17 20:04 gtback

That's generally the idea - I'm not sure it would be an easy transition - but I just wanted to put in an issue for it.

The main reason to change is efficiency. There is a nested loop in interatively_resolve_placeholder_refs which is very expensive - which I think could be avoided

rpiazza avatar Apr 27 '17 14:04 rpiazza