Repository navigation
Speed up BufferApiView.getLine and remove BufferLineApiView - #6193
Conversation
Instead, have BufferLine implement IBufferApi by adding a getLine method.
Speed up BufferApiView.getLine and remove BufferLineApiView (thanks @PerBothner)
|
This is part of the large PR #6160. |
jerch
left a comment
There was a problem hiding this comment.
Getting rid of costly abstractions is a good thing. ❤️
One minor nag: Please add a comment in the bufferline source, that the internal API is directly exposed to public as a warning. I am not sure, if the public API paths are fully tested and the least we want is surprising sideeffects on public API from internal changes.
|
Not sure I'd say "the internal API is directly exposed to public" - you still have to do a cast - and I suspect you have to go via As opposed to the old code: It seems weird adding a comment in |
The
IBufferApiin the "public API" has agetLinemethod which is implemented by (on each call) creating a newBufferLineApiViewobject as a proxy for aBufferLine. This is quite expensive. Other parts of the API just coerce the internal interface to the public API interface. We can't coerceBufferLineto aIBufferLineApibecauseBufferLinedoesn't implementgetCell. However, it is trivial to addgetCell, so I did.