Skip to content

Instantly share code, notes, and snippets.

View casouri's full-sized avatar
💭
I may be slow to respond.

Yuan Fu casouri

💭
I may be slow to respond.
View GitHub Profile
(defun scroll-up-benchmark ()
(interactive)
(let ((oldgc gcs-done)
(oldtime (float-time))
(count 0))
(condition-case nil (while t (scroll-up) (redisplay) (cl-incf count))
(error (message "GCs: %d Elapsed time: %f seconds Second/scroll: %f"
(- gcs-done oldgc) (- (float-time) oldtime)
(/ (- (float-time) oldtime) count))))))
@casouri
casouri / eglot-rust-analyzer.el
Last active December 28, 2024 16:19
Configuring eglot for rust-analyzer
;; How to translate LSP configuration examples into Eglot’s format:
;;
;; Usually LSP servers will say something like
;;
;; rust-analyzer.procMacro.attributes.enable (default: true)
;;
;; Translate that into a JSON LSP configuration, you get
;;
;; {
;; "rust-analyzer": {
Cost: (besides storage cost)
8 KB/object for metadata in s3, bill at s3 price
32 KB/object for index in glacier, billed at glacier price
Early deletion/overwrite fee: Delete or overwrite before stored for 90
days (glacier) or 180 days (deep glacier).
Transition cost/object: