As far as I know, if you have the RAM, it's okay, but if Emacs ever did hit really high usage before GC'ing, it might take a long time. I'm not sure exactly what Eli means; ISTM that if you have enough memory, it should be okay, but he's the expert here.
Having said that, I've used these lines in my init file for a while now, and it helps reduce startup time without making the changes permanent:
;;;;; Startup optimizations
;;;;;; Set garbage collection threshold
;; From https://www.reddit.com/r/emacs/comments/3kqt6e/2_easy_little_known_steps_to_speed_up_emacs_start/
(setq gc-cons-threshold-original gc-cons-threshold)
(setq gc-cons-threshold (* 1024 1024 100))
;;;;;; Set file-name-handler-alist
;; Also from https://www.reddit.com/r/emacs/comments/3kqt6e/2_easy_little_known_steps_to_speed_up_emacs_start/
(setq file-name-handler-alist-original file-name-handler-alist)
(setq file-name-handler-alist nil)
;;;;;; Set deferred timer to reset them
(run-with-idle-timer
5 nil
(lambda ()
(setq gc-cons-threshold gc-cons-threshold-original)
(setq file-name-handler-alist file-name-handler-alist-original)
(makunbound 'gc-cons-threshold-original)
(makunbound 'file-name-handler-alist-original)
(message "gc-cons-threshold and file-name-handler-alist restored")))
gc-cons-threshold
any higher than you're willing to actually hit at any given time, because you ought to assume that you will actually hit that value from time to time (after all, who knows how much garbage might be accrued by some unexpectedly-enthusiastic non-idle task). I don't see a particular problem with triggering gc with an idle timer, but I think setting the threshold for non-idle gc as high as this seems OTT, and my impression is that the value was probably chosen as being "higher than I'll ever need" rather than "the highest I'm willing to use".(eval-when-compile (* 1024 1024 1024))
withmost-positive-fixnum
(please do so, I'm pretty sure everybody who comes across your question copies your code into their config).