igorkasyanchuk / rails_db

Rails Database Viewer and SQL Query Runner
https://www.railsjazz.com/
MIT License
1.46k stars 111 forks source link

Reduce mem footprint #40

Closed bbenezech closed 8 years ago

bbenezech commented 8 years ago

axlsx_rails is a memory hog and is only needed for a very specific task. I would not hard require it if I had the choice. Would you consider removing the dependency?

bbenezech commented 8 years ago

I'll also have a look at https://github.com/igorkasyanchuk/rails_db/blob/master/lib/rails_db.rb#L1-L11

We load these library too early. Some server may never need RailsDb dependencies if no user is allowed access to it.

Plus we slow down startup on development machines, 300ms on my (fast) machine.

igorkasyanchuk commented 8 years ago

@bbenezech such libraries need to be added (or something need to be changed to support standalone version of rails_db). Also what if we will just change axlsx_rails gem to something very lightweight (just a plain XML file?)

igorkasyanchuk commented 8 years ago

@bbenezech also, just noticed tests are failed in Travis CI

bbenezech commented 8 years ago

Sorry about that. Behavior differences between local and CI envs for dev dependencies got me. Fixed build with 20f1b659f4f23b3e9aeb474bd678b42ad75e60eb

bbenezech commented 8 years ago

axlsx_rails is a good lib. Reinventing the wheel may add maintenance overhead. But for 90% of users, csv is good enough I imagine.

igorkasyanchuk commented 8 years ago

@bbenezech what if we will keep link "Export to XLS" but instead of generation we will put a page with clear instructions what they need to do (add gem to gem file, restart server) to have this export to Excel functionality

bbenezech commented 8 years ago

@igorkasyanchuk I find this a tad overkill. And the user may not now anything about the server and gems. I'd rather assume the dev will read the doc and do what's needed for its users. Your call!

igorkasyanchuk commented 8 years ago

okay, let it be this way. we just need to have clear instructions somewhere (on github and maybe in gem itself to have some page with instructions).

bbenezech commented 8 years ago

Yep, I did add smtg: https://github.com/igorkasyanchuk/rails_db/commit/da11030d6389ca59880bcde3980e2a6b5b59aeb2

igorkasyanchuk commented 8 years ago

@bbenezech hello :) new version of gem was just pushed happy new year!

bbenezech commented 8 years ago

@igorkasyanchuk Thanks! Happy new year! :tada: Can you also push a minor on AnyLogin?

igorkasyanchuk commented 8 years ago

it was merged to master. you just want to make a new version of gem?

bbenezech commented 8 years ago

@igorkasyanchuk Yes. A new minor release.

igorkasyanchuk commented 8 years ago

Pushed. Thanks