Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PERF: Styler render improvement by limiting .join() #39952

Merged
merged 3 commits into from
Feb 21, 2021

Conversation

attack68
Copy link
Contributor

Currently
<th> only have attributes when there is a row or column span.
<td> never have attributes currently.
So there is no need for repititive join() operations, especially inside the jinja2 template. Could be preconfigured outside.

We can get around 10-15% better render times.

[ 75.00%] ··· io.style.RenderApply.time_render                                                                                                           ok
[ 75.00%] ··· ====== ============ ============
              --                rows          
              ------ -------------------------
               cols       12          120     
              ====== ============ ============
                12    11.6±0.5ms   77.0±0.5ms 
                24    29.2±0.5ms    144±1ms   
                36    43.7±0.9ms    209±2ms   
              ====== ============ ============

versus master

[100.00%] ··· io.style.RenderApply.time_render                                                                                                           ok
[100.00%] ··· ====== ============ ==========
              --               rows         
              ------ -----------------------
               cols       12         120    
              ====== ============ ==========
                12    12.9±0.4ms   89.8±4ms 
                24    31.4±0.9ms   166±2ms  
                36     46.5±2ms    250±40ms 
              ====== ============ ==========

@jreback jreback added the Styler conditional formatting using DataFrame.style label Feb 21, 2021
@jreback jreback added this to the 1.3 milestone Feb 21, 2021
@jreback jreback merged commit 43968df into pandas-dev:master Feb 21, 2021
@jreback
Copy link
Contributor

jreback commented Feb 21, 2021

thanks @attack68

@attack68 attack68 deleted the perf_template_td_attributes branch February 22, 2021 07:00
@attack68 attack68 added the Performance Memory or execution speed performance label Mar 30, 2021
@attack68 attack68 mentioned this pull request Jun 1, 2021
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Performance Memory or execution speed performance Styler conditional formatting using DataFrame.style
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants