-
-
Notifications
You must be signed in to change notification settings - Fork 1
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
Failing to compile with shadow-cljs "release" #5
Comments
I think I need to fix those issues - they are simple ones to fix. The performance benefits of ham-scripted are 10X+ the base clojurescript hashmap so it is well worth it especially when the datasets grow. |
I think these are fixed. I cleaned up the errors and warnings and the minimal tests pass in dev compilation mode. If your app doesn't work as expected in release I think it will be because of missing symbols - something didn't get marked as an extern - and I will revisit a bit more thoroughly with the testapp in tmdjs. 2.000-beta-3 |
That worked :)) thank you! |
I spoke too early I'm afraid. Thanks to your changes the app compiles, however the production js fails with a cryptic JS message (as all the code is compiled) when a Thank you, |
What is the message? |
Those really can be tough to debug - I wonder what the best way to debug it is. Perhaps instrumenting some of the code with println will but that will require I think customizing tmdjs. |
Thanks Chris. The console says:
The
The
I will try a minimal example and see if I can learn more. |
That is the chunked vector reduction code. C in this case is checking if the initial value is reduced. kb is the hash provider. In any case this looks like a totally legit issue and something I will have to get into; it is in ham-scripted not in tmdjs specifically so perhaps ham-scripted needs release-mode tests. |
And more specifically it looks like the hash provider's member variables are being 'optimized' differently across modules. |
Thank you for investigating! I will play around with ham-scripted and see if I find out more! |
The api declares the real hash provider here. I wonder if that means those declarations are not mangled while the compiler in ChunkedVec is assuming they are and then by extension I wonder if hash provider member variable references should all be quoted strings to stop the compilation. |
I updated ham-scripted and tmdjs to run unit tests both in debug mode and release mode and fixed all the fallout including exactly your issue. 2.000-beta-5 should work for you but let's keep this issue open until we know for sure. |
this has worked Chris, legend!! Thank you! as a small gotcha in java |
Ah - I will get to that. The reason is for future proofing. In the event the column has an index, passing in a value or a set of values allows the index to participate in the query. Passing in an opaque function does not. |
Fixed, scalars and sets are supported and tested. |
haha nice thanks! |
Speaking of filtering - since you are working with timeseries data - keep in mind that tech.v3.datatype.argops has a binary-search mechanism that will be far faster than filtering in many cases - cljs.user> (def small (ds/->dataset {:t (range 50000 51000)}))
#'cljs.user/small
cljs.user> (def big (ds/->dataset {:t (range 51000)}))
#'cljs.user/big
cljs.user> (argops/binary-search (range 51000) 50000)
50000
cljs.user> (time (argops/binary-search (range 51000) 50000))
"Elapsed time: 0.090592 msecs"
"Elapsed time: 0.090592 msecs"
50000
cljs.user> ;;Let's take advantage of the fact the column is sorted.
cljs.user> (defn sorted-take-last
[ds col val]
(let [vidx (argops/binary-search (ds col) val)]
(ds/select-rows ds (range vidx (ds/row-count ds)))))
#'cljs.user/sorted-take-last
cljs.user> (sorted-take-last big :t 50000)
#dataset[unnamed [1000 1]
| :t |
|------:|
| 50000 |
| 50001 |
| 50002 |
| 50003 |
| 50004 |
| ... |
| 50994 |
| 50995 |
| 50996 |
| 50997 |
| 50998 |
| 50999 |]
cljs.user> (time (sorted-take-last big :t 50000))
"Elapsed time: 0.553483 msecs"
"Elapsed time: 0.553483 msecs"
#dataset[unnamed [1000 1]
| :t |
|------:|
| 50000 |
| 50001 |
| 50002 |
| 50003 |
| 50004 |
| ... |
| 50994 |
| 50995 |
| 50996 |
| 50997 |
| 50998 |
| 50999 |]
cljs.user> |
super interesting - thanks Chris! |
Hello Chris,
Using shadow-cljs latest, I can work with tmdjs in a dev environment, but release fails with the following:
This is my project.clj
and shadow-cljs.edn
Any idea what needs to be done? thanks,
The text was updated successfully, but these errors were encountered: