Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance enhancements #48

Open
sprocketc opened this issue Apr 5, 2022 · 0 comments
Open

Performance enhancements #48

sprocketc opened this issue Apr 5, 2022 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@sprocketc
Copy link
Member

sprocketc commented Apr 5, 2022

The following architectural decisions might evolve into performance bottlenecks in the future and require further investigation.
A nice read about ClojureScript performance from juxt

Multimethods vs Protocols

We are currently using multimethods in order to dispatch the correct function depending on the selected tool or element.
Protocols' dispatching should be much faster and they are also open to dynamic extension, just like multimethods.
Clojure docs on runtime polymorphism
Old but related discussion

Immutable vs Mutable matrix operations

We are using mikera/core.matrix for our matrix operations.
We need to investigate the performance cost of the immutable data structures and also the cljs implementation of the library in general.
Related ClojureScript issue
Related talk of Mike Anderson

Reducers vs Transducers

We should consider using transducers for chained transformations.
https://clojure.org/reference/transducers
https://clojure.org/guides/faq#transducers_vs_seqs

String literals vs Collections for attribute values

Element attributes are currently saved as strings on our db. Any input value is considered valid and is going to be used as an attribute of the element on the SVG canvas. The problem is that to manipulate those strings, extra transformations are required.
For instance, if we have a long d attribute on a path element, converting the string to a vector of instructions every time we need to transform it is expensive. We might have to reevaluate this decision or find a way to cache the collections.

Eliminate callback functions from render

See https://day8.github.io/re-frame/Performance-Problems/#4-callback-functions

Optimize Speed vs Default text-rendering and shape-rendering

Setting those properties to optimizeSpeed would probably reduce the quality a lot, but it is worth investigating this for specific cases.

@sprocketc sprocketc self-assigned this Apr 5, 2022
@sprocketc sprocketc added the enhancement New feature or request label Apr 5, 2022
@sprocketc sprocketc added this to the Prototype milestone Apr 5, 2022
@sprocketc sprocketc moved this to In Progress in Repath Studio Apr 5, 2022
@sprocketc sprocketc changed the title Performance investigation Performance enhancements Apr 5, 2022
@sprocketc sprocketc pinned this issue Apr 5, 2022
@sprocketc sprocketc removed this from the Prototype milestone Oct 30, 2023
@sprocketc sprocketc unpinned this issue Nov 13, 2023
@sprocketc sprocketc pinned this issue Nov 22, 2023
@sprocketc sprocketc unpinned this issue Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: In Progress
Development

No branches or pull requests

1 participant