Skip to content

Instantly share code, notes, and snippets.

@yyoncho
Last active March 23, 2019 13:21
Show Gist options
  • Save yyoncho/9e9c4e14734fdd9a22d6600a88a27ae1 to your computer and use it in GitHub Desktop.
Save yyoncho/9e9c4e14734fdd9a22d6600a88a27ae1 to your computer and use it in GitHub Desktop.
Performance testing
(defconst json-string
(with-temp-buffer
(insert-file-contents-literally "/home/kyoncho/Public/Desktop/large.json")
(buffer-string)))
(progn
(setq my/call-counter 0)
(defun my/test-query-function (&rest args)
(incf my/call-counter)
t)
(add-hook 'kill-buffer-query-functions #'my/test-query-function)
(json-parse-string json-string)
my/call-counter) ;; => 32982
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment