Skip to content

RleDecoder Inline Buffer #1061

@tustvold

Description

@tustvold

Is your feature request related to a problem or challenge? Please describe what you are trying to do.

RleDecoder has an buffer inlined within the struct here. This is perhaps surprising as it results in a struct that is 4Kb in size, with all the implications that has for the cost of moves, etc...

I only noticed this because clippy's large enum variant lint tripped whilst working on #1054.

My solution there was to use Box<RleDecoder> but I think it might be better to heap allocate this buffer, especially since it is only used by RleDecoder::get_batch_with_dict which may not even be called.

Describe the solution you'd like

Change the type of index_buf from [i32; 1024] to Option<Box<[i32; 1024]>>

Describe alternatives you've considered

It could be left unchanged

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementAny new improvement worthy of a entry in the changelog

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions