This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-11-09
Channels
- # aws (3)
- # bangalore-clj (3)
- # beginners (40)
- # boot (53)
- # cider (1)
- # cljs-dev (124)
- # cljsrn (22)
- # clojure (105)
- # clojure-italy (1)
- # clojure-nl (3)
- # clojure-russia (35)
- # clojure-spec (9)
- # clojure-uk (30)
- # clojurebridge (25)
- # clojurescript (107)
- # datomic (18)
- # dirac (21)
- # events (6)
- # hoplon (29)
- # leiningen (5)
- # off-topic (40)
- # om (17)
- # onyx (25)
- # parinfer (2)
- # pedestal (4)
- # perun (2)
- # planck (1)
- # protorepl (6)
- # re-frame (18)
- # reagent (15)
- # ring-swagger (4)
- # specter (2)
- # test-check (7)
- # testing (3)
- # untangled (45)
- # vim (2)
@dnolen a little late, but re: my question about profiling...the code i'm comparing uses createFactory rather abusively and the generating functions aren't identical, map vs. for loop not a great comparison, but the fwiw the om version is actually lagging behind the further i push it whereas the js one seems bound to 40% cpu usage. again, i'd just chalk that up to the functions employed and say i greatly prefer the simplicity. but i guess it shows i was always managing the react lifecycle well, plus good thing i didn't try to sell that client based on benchmarks (i seem sold anyway) since i may have had to hack through tons of things manually to beat what he had that way. although he wasn't using any comparable framework previously so perhaps not. anyway, grain of salt... but seems to back up what you told me
@jcb - i think js/document.querySelector is a thing, or may js/document.querySelectorAll, google until you fin dosmething that looks like that
what you are describing is a bit unusual though - usually you’d want to epxress your components’ css using reagent
but if you have a specific reason why you want to do this, i think that that function is what i’d reach for
hm, (js/console.log (.-style (js/document.querySelector “canvas”))) works fine if i paste it into one of the snippet boxes on http://blog.jrheard.com/procedural-dungeon-generation-drunkards-walk-in-clojurescript
It's to get around an odd z-index problem with a frontend that has been written by someone else
you should be able to manipulate this style object with aget
and aset
, if memory serves
(aset (.-style (js/document.querySelector "canvas")) "background-color" “pink”) seems to work well, for instnace
So I’m pretty much a total CLJS newb, and I’m having problems pretty printing an object in Node on AWS lambda.
I’m trying to print the environment variables out, so I’m doing this: (println (pr-str (js->clj (.. js/process -env))))
Similarly, (get (js->clj (.. js/process -env)) "AWS_ACCESS_KEY_ID”)
results in nil
, but (aget (.. js/process -env) "AWS_ACCESS_KEY_ID”)
produces the value I want.
@cfleming I know nothing about AWS but most likely js/process.env
is not a normal javascript object but something else which js->clj
does not support
@cfleming https://github.com/Gozala/node.core/blob/6e646f8b482b1defbb095537135fa84e2e64df40/src/node/utils.cljs
if the object is shallow you can probably (-> js/process.env (js/goog.object.clone) (js->clj))
I think I’ll just aget
it right now, and write to the author of cljs-lambda
to ask about it.
Long shot: Has anyone used multiple textures with http://thi.ng geom?
have an interesting issue with :advanced
mode build:
https://gist.github.com/darwin/34b2eaf97f1823b1180eb14ad64af9fd
initial-config
is not used so it should be elided, 01 does not elide it, 02 does
note the comment there
it looks like I’m hitting some arbitrary limit on how deep closure compiler goes analysing my code, but this depth is pretty shallow IMO
Is it possible to access the current compiler profile, so as to use one app-state for dev and another for prod?
@wielderofmjolnir this can be done via a macro
Oh, sweet! Thanks!
In order to get consistent performance benchmarks, does it make sense to run the code you are trying to benchmark in several tabs (say 100) then aggregate the time results once all the tabs have finished running the code? Obviously I would prefer to not have 100 tabs open and close, is there a better way to run cljs code (targeting the browser) many times in an isolated environment?
if you’re serious about benchmarking you also want to make sure you’re not running anything else but the benchmark
plus your benchmark would be “how fast does this code run… while being also run 99 other times."
In this case, I am really just looking for relative performance, not absolute. So, if all tabs are unfocused would they get penalized in an equal amount, making the results consistent but inaccurate?
if it’s not browser specific - just run it against Node or even better an unadorned JS VM like JavaScriptCore
if you’re not looking for particularly accurate results - then no the methodology doesn’t matter - but I wouldn’t put any real trust in whatever information you collect
You wouldn't trust the results if the benchmark was ran in the same way and then compared? It seems like the consistency is trustworthy (if it is consistent)
@kenny i use https://github.com/ptaoussanis/tufte for relative benchmarking fwiw
when optimizing a fucntion, i just run the function under test like 250 times or whatever, in one tab, and then make a change and then run it again in the same way
if i see too much variation then i bump up the number of times i run it and that usually solves the problem
@jrheard Right. That normally works great. Also, thanks for the Tufte suggestion. I will take a look at it 🙂 The only problem with that method is when you are not testing pure functions (`memoize`ed functions).
if it’s a function you control, perhaps you could add a flag that turns off memoization?
I’ve done too much benchmarking around ClojureScript to believe anything that doesn’t follow the procedures I outlined above
there is just so much that can be going on with with the browser and the OS and threads and scheduling and stuff right? you’d have to be an expert at so many things to know what you could count on and what is random system jitter and how many threads make your machine start to spend a ton of time worrying about overhead vs. running your tests
@dnolen @cschep @jrheard thanks for the input! 🙂 I will change the direction I was headed down.
@cschep fancy seeing you here
@noisesmith hey man! long time!