Page MenuHomeFreeBSD

rb_tree: optimize tree rotation
ClosedPublic

Authored by dougm on Jun 19 2022, 2:59 AM.
Tags
None
Referenced Files
F163422479: D35520.id107147.diff
Thu, Jul 23, 2:09 AM
F163409307: D35520.id107369.diff
Wed, Jul 22, 11:19 PM
F163383182: D35520.id107182.diff
Wed, Jul 22, 5:26 PM
Unknown Object (File)
Wed, Jul 22, 1:28 PM
Unknown Object (File)
Tue, Jul 21, 3:05 AM
Unknown Object (File)
Sun, Jul 19, 8:36 PM
Unknown Object (File)
Tue, Jul 14, 5:58 AM
Unknown Object (File)
Sun, Jul 12, 8:06 PM
Subscribers

Details

Summary

The RB_ROTATE macros begin with fetching a field via a pointer. In almost most cases, that value is one that is already in a register, and the compiler cannot infer it. So, to eliminate those needless fetches, have the caller of the RB_ROTATE macros present the data in the third macro parameter, rather than having the macro fetch it.

And a few minor style cleanups.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

dougm requested review of this revision.Jun 19 2022, 2:59 AM
dougm created this revision.

Rename variables in REMOVE_COLOR (elm->child, sib->elm) to make it look more like the INSERT_COLOR code.

Find a better (smaller) way to set 'child' in RB_INSERT_COLOR. Reduce lip3 size from 8830 to 8734.

This revision is now accepted and ready to land.Jun 25 2022, 7:30 AM
This revision was automatically updated to reflect the committed changes.