mirror of
https://github.com/penpot/penpot.git
synced 2025-05-29 13:06:11 +02:00
⚡ Implement get-handlers in term of internal reduce
That has an average performance improvement of 64% over original impl and reduction of generation of object garbage
This commit is contained in:
parent
7196be2a23
commit
1c77126fe6
4 changed files with 49 additions and 20 deletions
|
@ -129,7 +129,7 @@
|
|||
ptk/WatchEvent
|
||||
(watch [_ state stream]
|
||||
(let [content (st/get-path state :content)
|
||||
handlers (-> (path.segment/content->handlers content)
|
||||
handlers (-> (path.segment/get-handlers content)
|
||||
(get position))
|
||||
|
||||
[idx prefix] (when (= (count handlers) 1)
|
||||
|
|
|
@ -300,11 +300,12 @@
|
|||
(mf/with-memo [content-points]
|
||||
(into #{} content-points))
|
||||
|
||||
last-p (->> content last path.helpers/segment->point)
|
||||
last-p
|
||||
(->> content last path.helpers/segment->point)
|
||||
|
||||
handlers
|
||||
(mf/with-memo [content]
|
||||
(path.segment/content->handlers content))
|
||||
(path.segment/get-handlers content))
|
||||
|
||||
is-path-start
|
||||
(not (some? last-point))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue