[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/phps-mode d76ba9f39f 22/29: Optimized cache storage siz
From: |
Christian Johansson |
Subject: |
[elpa] externals/phps-mode d76ba9f39f 22/29: Optimized cache storage size |
Date: |
Thu, 15 Feb 2024 03:14:37 -0500 (EST) |
branch: externals/phps-mode
commit d76ba9f39f8e4ea8a0546417517edc4f0a76f915
Author: Christian Johansson <christian@cvj.se>
Commit: Christian Johansson <christian@cvj.se>
Optimized cache storage size
---
phps-mode-lex-analyzer.el | 20 ++++++++++++++++----
phps-mode-lexer-generator.el | 17 +----------------
phps-mode-lexer.el | 11 +++--------
3 files changed, 20 insertions(+), 28 deletions(-)
diff --git a/phps-mode-lex-analyzer.el b/phps-mode-lex-analyzer.el
index ff236313c1..65ec472a84 100644
--- a/phps-mode-lex-analyzer.el
+++ b/phps-mode-lex-analyzer.el
@@ -257,7 +257,8 @@ ALLOW-CACHE-READ and ALLOW-CACHE-WRITE."
(phps-mode-lex-analyzer--set-region-syntax-color
start
end
- (list 'font-lock-face token-syntax-color)))))))
+ (list 'font-lock-face token-syntax-color))))))
+ (thread-yield))
(let ((current-time (current-time)))
(setq
@@ -993,7 +994,12 @@ of performed operations. Optionally do it
FORCE-SYNCHRONOUS."
cache-value)))))
(if loaded-from-cache
- loaded-from-cache
+ (progn
+ (phps-mode-debug-message
+ (message
+ "Loaded from file-system cache: %S"
+ loaded-from-cache))
+ loaded-from-cache)
(let* ((buffer (generate-new-buffer "*PHPs Parser*"))
(cache)
(tokens)
@@ -1003,6 +1009,10 @@ of performed operations. Optionally do it
FORCE-SYNCHRONOUS."
(bookkeeping)
(imenu)
(symbol-table))
+ (phps-mode-debug-message
+ (message
+ "Did not load from file-system cache-key: %S"
+ cache-key))
;; Create temporary buffer and run lexer in it
(when (get-buffer buffer)
@@ -1075,10 +1085,12 @@ of performed operations. Optionally do it
FORCE-SYNCHRONOUS."
allow-cache-write
cache-key)
(phps-mode-debug-message
- (message "Saved to cache"))
+ (message "Saving cache..."))
(phps-mode-cache-save
data
- cache-key))
+ cache-key)
+ (phps-mode-debug-message
+ (message "Saved to cache")))
data)))))
diff --git a/phps-mode-lexer-generator.el b/phps-mode-lexer-generator.el
index fe136f54f3..d7eff3494a 100644
--- a/phps-mode-lexer-generator.el
+++ b/phps-mode-lexer-generator.el
@@ -28,9 +28,6 @@
(defvar-local phps-mode-lexer--state-stack nil
"Current state-stack of lexer.")
-(defvar-local phps-mode-lexer--states nil
- "History of state and state-stack.")
-
(defvar-local phps-mode-lexer--heredoc-label nil
"Current heredoc label.")
@@ -2044,19 +2041,7 @@
(buffer-substring-no-properties
start
end)
- `(,token ,start . ,end)))
-
- ;; Push token start, end, lexer state and state stack to variable
- (push
- (list
- start
- end
- phps-mode-lexer--state
- phps-mode-lexer--state-stack
- phps-mode-lexer--heredoc-label
- phps-mode-lexer--heredoc-label-stack
- phps-mode-lexer--nest-location-stack)
- phps-mode-lexer--states))
+ `(,token ,start . ,end))))
(defun phps-mode-lexer--get-next-unescaped (character)
"Find where next un-escaped CHARACTER comes, if none is found return nil."
diff --git a/phps-mode-lexer.el b/phps-mode-lexer.el
index dfd2b3a48d..e41ba52829 100644
--- a/phps-mode-lexer.el
+++ b/phps-mode-lexer.el
@@ -92,19 +92,15 @@
;; Set state here
(let ((old-state-state (nth 0 old-state))
(old-state-stack (nth 1 old-state))
- (old-state-states (nth 2 old-state))
- (old-state-heredoc-label (nth 3 old-state))
- (old-state-heredoc-label-stack (nth 4 old-state))
- (old-state-nest-location-stack (nth 5 old-state)))
+ (old-state-heredoc-label (nth 2 old-state))
+ (old-state-heredoc-label-stack (nth 3 old-state))
+ (old-state-nest-location-stack (nth 4 old-state)))
(setq
phps-mode-lexer--state
old-state-state)
(setq
phps-mode-lexer--state-stack
old-state-stack)
- (setq
- phps-mode-lexer--states
- old-state-states)
(setq
phps-mode-lexer--heredoc-label
old-state-heredoc-label)
@@ -232,7 +228,6 @@
(list
phps-mode-lexer--state
phps-mode-lexer--state-stack
- phps-mode-lexer--states
phps-mode-lexer--heredoc-label
phps-mode-lexer--heredoc-label-stack
phps-mode-lexer--nest-location-stack))
- [elpa] externals/phps-mode ad00c6eac5 27/29: Updated parser generator information and cleaned up code, (continued)
- [elpa] externals/phps-mode ad00c6eac5 27/29: Updated parser generator information and cleaned up code, Christian Johansson, 2024/02/15
- [elpa] externals/phps-mode 0262e707ca 05/29: Passing more parsing tests, Christian Johansson, 2024/02/15
- [elpa] externals/phps-mode 396397b97d 06/29: Passing all old unit tests for parser, Christian Johansson, 2024/02/15
- [elpa] externals/phps-mode c2716544f4 10/29: Started on SDT for PHP 8.3, Christian Johansson, 2024/02/15
- [elpa] externals/phps-mode aa2a23c296 18/29: Started on incremental lexer support again, Christian Johansson, 2024/02/15
- [elpa] externals/phps-mode 34d34330a2 13/29: Passing unit tests for indentation, Christian Johansson, 2024/02/15
- [elpa] externals/phps-mode 9bbd3cd7fa 14/29: Some byte compilation fixes, Christian Johansson, 2024/02/15
- [elpa] externals/phps-mode 5681944d10 20/29: Passing all unit tests and byte compilation with incremental lexer, Christian Johansson, 2024/02/15
- [elpa] externals/phps-mode 055ca735f1 21/29: Cache validation check, Christian Johansson, 2024/02/15
- [elpa] externals/phps-mode a24fb65377 23/29: Fix for environment were threads support is lacking, Christian Johansson, 2024/02/15
- [elpa] externals/phps-mode d76ba9f39f 22/29: Optimized cache storage size,
Christian Johansson <=