dexplo / dataframe_image

A python package for embedding pandas DataFrames as images into pdf and markdown documents
https://dexplo.org/dataframe_image
MIT License
282 stars 41 forks source link

Extremely slow - can I set chrome options? #63

Closed RT-Tap closed 1 year ago

RT-Tap commented 1 year ago

Hi, I'm trying to export some simple dataframes to a png. Nothing complex, like 2 columns 15 rows max however it takes over 4 minutes to create each png which is kind of ridiculous. When I first installed dataframe_images it was slow but not this slow and after a day or two it just became extremely slow not sure why. Everything I find online with regard to setting chrome headless parameters is from the command line or using something like selenium. So I was curious where I could set chrome options for use either permanently or during export/creation of pngs?

I wanted to try passing these parameters in hopes of speeding it up : --headless , --no-sandbox , --disable-gpu , --no-proxy-server , --proxy-server='direct://' , --proxy-bypass-list=*.

Also this is the output during creation of the png files:

[1228/124439.617433:ERROR:bus.cc(393)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
[1228/124439.617979:WARNING:headless_browser_main_parts.cc(83)] Cannot create Pref Service with no user data dir.
[1228/124439.619406:ERROR:gpu_init.cc(426)] Passthrough is not supported, GL is disabled
[1228/124902.773720:INFO:headless_shell.cc(620)] Written to file /tmp/tmplvmz4fbd/temp.png.

But I don't think any of these are responsible for slowing chrome down this bad.

Also some extra info: Python 3.8.10 Ubuntu 20.04.5 LTSRelease: 20.04 Codename: focal

If you need anymore info please let me know, open to any and all suggestions! Thank you.

PaleNeutron commented 1 year ago

Of cource you could, just look at this answer https://github.com/dexplo/dataframe_image/issues/68#issuecomment-1379937728 and replace args to whatever you want.

If any argument really speed it up please update it here.