Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upOverhead in pull-attr-datoms #221
Conversation
This comment has been minimized.
This comment has been minimized.
|
No point in constructing a vector through transducer if the end goal is to see if something is found or not. This will always resolve since default value is +default-limit+ Since this function is part of recursive algorithm and is called alot imo this brings alot of overhead |
This comment has been minimized.
This comment has been minimized.
|
Same goes for the code below. Is there a point in using cond-> and cond->> if single condition is tested? As well as construcing new vector... |
Hi,
For one of our projects we are using Datascript in combination with Om/next for rendering our frontend. Using DB on frontend is really nice for rendering DOM elements. We are working with quite big datasets on frontend that have alot of relations between them.
As our project grows dataset is getting larger and larger and we are pulling more and more data for rendering. IE. in one part of application we are pulling about 520 entites that represent user tasks. Each of this task is linked to a project and to the person that assinged task, group and so on... So we have about 3-5 references to other entities.
This pull takes about ~0.5-7 seconds and feels slowish.
--
When going through dev tools in Chrome we've noticed that clojure.core/into is taking alot of "Total Time" when calling datascript.core/pull so we've modified datascript.pull-api/pull-attr-datoms to see what will happen.
Results are that execution time was cut down for ~100-150 ms.
Can you please check out changes and comment?
Tnx
This change is