[Libre-soc-bugs] [Bug 1094] insndb instruction database visitor-walker is needed

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Tue Jun 20 20:23:05 BST 2023


--- Comment #212 from Jacob Lifshay <programmerjake at gmail.com> ---
(In reply to Dmitry Selyutin from comment #211)
> (In reply to Jacob Lifshay from comment #210)
> > (In reply to Dmitry Selyutin from comment #209)
> > imho this or the one returning objects with node, parent, and path fields is
> > good. I do think we should pick whichever option is faster, since the walker
> > is likely hot code.
> I think yielding a tuple would be better then. Plus I kinda dislike the
> wrapping here, though cannot clearly formulate why (even for myself).
> Also, on paths. If we yield the parent (which I assumed is the original
> instance), perhaps the path should point to this parent, and not to the
> root? We currently keep the whole path.

you still need to know which child of the parent you are...

also, if you use a list for path, and just push and pop indexes from the end
rather than making a new object every time then you don't need to constantly
allocate as much, which is a bit faster.

also, i think the library should provide a function that has the top-level for
loop running both walker and visitor

You are receiving this mail because:
You are on the CC list for the bug.

More information about the libre-soc-bugs mailing list