helix

https://github.com/Lokeh/helix
Lucy Wang 2020-04-27T09:30:13.486800Z

Hello guys, is there any real world perf benchmarking to see the advantange of helix over reagent? After reading the README / playing with it / read the source code of helix, I see helix has quite some focus on rendering performance (e.g. it didn't use hiccup to avoid the cost). But I'd like to see some real world numbers.

Lucy Wang 2020-04-27T09:31:30.488200Z

I know helix is not only about performance - I'm aware of the simplicity provided by helix due to not adding an extra layer on top of vanilla react. But just curious about the overall performance comparison.

Aron 2020-04-27T09:37:41.489Z

I am not sure if there is any atm. Do you know any such performance measurements, benchmarking suite that could be adopted?

lilactown 2020-04-27T14:59:49.494200Z

Hey @wxitb2017 👋 when developing hx (helix’s predecessor) I was working on a hiccup parser and was using some microbenchmarks to see how it performed compared with some other libs. At the time, reagent was about 1/4 the speed of doing direct calls to createElement and was probably the fastest hiccup interpreter

lilactown 2020-04-27T15:01:52.496700Z

I don’t have a benchmark against reagent, but I do have a similar microbenchmark to measure performance regressions that compares helix’s macros to direct createElement calls, and my tests they are usually within 10% of each other

lilactown 2020-04-27T15:03:21.498600Z

It’s not a very scientific way of comparing the two, but it gives you an idea

lilactown 2020-04-27T15:06:13.000200Z

If you clone helix and run the :dev build, you can uncomment that form and the card below it to run the microbenchmark

lilactown 2020-04-27T15:07:09.001700Z

It’s not indicative of a real world project, just how fast can you create elements, which is the biggest trade off that helix makes since it doesn’t use hiccup

lilactown 2020-04-27T15:10:36.002700Z

I think @dominicm did was doing some benchmarks too, not sure if he is comfortable sharing

dominicm 2020-04-27T15:11:07.003100Z

I did some size benchmarks, but not performance.

dominicm 2020-04-27T15:11:13.003400Z

Those are still WIP

lilactown 2020-04-27T15:15:24.003700Z

Ah right right

Lucy Wang 2020-04-27T15:17:42.004100Z

Thx @lilactown!

Lucy Wang 2020-04-27T15:18:03.004300Z

btw I have a small pr for helix https://github.com/Lokeh/helix/pull/43

lilactown 2020-04-27T15:25:00.004800Z

Great! I’ll take a look in a bit

Aron 2020-04-27T15:26:16.005600Z

what's the appropriate way to pass an "array" of react components as children to a Fragment?

Aron 2020-04-27T15:26:41.006100Z

I went with (map) first but I am starting to have the feeling that although it works, it's not appropriate : D

Lucy Wang 2020-04-27T15:38:57.007600Z

@ashnur I think it's okay, helix calls (apply react/reactElement nil children) and children could be any seq IIUC

Aron 2020-04-27T15:40:42.008200Z

thanks, I am very newb with clojure 😞, that looks exactly what I needed

Aron 2020-04-27T15:42:12.009400Z

now that you point it out, I was looking elsewhere in the code. I am not there you to find these easily in clojure. Show me js code and I can read it fast. : )

👍 1