smartcore icon indicating copy to clipboard operation
smartcore copied to clipboard

Consider implementing memory pooling system

Open Mec-iS opened this issue 6 months ago • 1 comments

Introduce buffer pooling (reuse temporary arrays across operations) for algorithms where memory allocation happens very frequently (like trees).

impl BaseTreeRegressor {
    pub fn fit_with_pooling(/* params */) -> Self {
        // Use pooling for tree construction
    }
    
    pub fn fit(/* params */) -> Self {
        // Regular allocation for simple cases
        self.fit_with_pooling(/* params */)
    }
}

For an extensive overview: https://gist.github.com/Mec-iS/4a0a068e5d6b6901125812c27f9e3b97

Mec-iS avatar Jul 11 '25 10:07 Mec-iS

I'll look into this

DanielLacina avatar Jul 12 '25 15:07 DanielLacina