Fork me on GitHub
#off-topic
<
2021-07-24
>
borkdude10:07:57

I'm considering to buy a Macbook Air M1 for traveling. I wonder if compiling GraalVM programs on such a machine would be comparably fast as on a Macbook Pro 2019 i9, roughly due to the M1, but perhaps Rosetta and the lack of active cooling make it worse... any experiences?

dharrigan10:07:20

I have a company issued MBP M1. It's really light, thin and fast! I throw a lot at it and it never really gets warm.

dharrigan10:07:40

If you're doing dev work, perhaps a MBP might be more suitable?

borkdude10:07:19

This is only for traveling and OSS dev though

borkdude10:07:58

(OSS dev while traveling on a train for example)

borkdude10:07:25

I could stick it out with my current Macbook Air 2015 but compiling babashka already isn't really an option with that one :)

dharrigan10:07:44

Yeah, difference between an Intel Mac and a M1 Mac is like night and day

dharrigan10:07:53

They really raised the bar with the M1.

dharrigan10:07:34

I don't notice a difference between an application (in terms of speed/performance), once Rosetta 2 has got it translated.

dharrigan10:07:17

I also run with the Azul JVM which (last I looked) is the only JVM available that runs natively on Arm64 for the Mac.

dharrigan10:07:44

I do believe version 17 of the JVM (Open/Adopt) will have Arm support for Mac natively.

borkdude10:07:10

@dharrigan it would be really useful to me if you could try to compile babashka on your M1 and see how long it takes, take a screenshot of the last 20 lines of output

dharrigan10:07:25

Sure. I can certainly do that for you, a bit later, would that be okay?

dharrigan10:07:35

@borkdude got some results for you 🙂

dharrigan10:07:38

I'll DM them to you

valtteri11:07:44

I don’t know if I’m the only one but I’d love to see the results as well 🙂

lassemaatta11:07:10

I was just about to say the same :)

borkdude11:07:20

Well, perhaps @dharrigan can post them in a gist :)

borkdude11:07:38

tl;dr: it's slower than my macbook pro i9, but faster than my older macbook air

lassemaatta11:07:42

for comparison, my newish Thinkpad P14S Gen 1 (Ryzen 7 pro 4750U, 32 gigs ram) took:

[bb:17543]   (typeflow):  23,700.72 ms,  4.90 GB
[bb:17543]    (objects):  66,759.19 ms,  4.90 GB
[bb:17543]   (features):   2,009.31 ms,  4.90 GB
[bb:17543]     analysis:  98,277.51 ms,  4.90 GB
[bb:17543]     universe:   4,615.15 ms,  5.71 GB
[bb:17543]      (parse):   2,051.17 ms,  5.27 GB
[bb:17543]     (inline):   5,563.54 ms,  4.72 GB
[bb:17543]    (compile):  28,879.32 ms,  5.04 GB
[bb:17543]      compile:  39,062.50 ms,  5.05 GB
[bb:17543]        image:   7,787.64 ms,  4.89 GB
[bb:17543]        write:     837.38 ms,  4.89 GB
[bb:17543]      [total]: 155,682.14 ms,  4.89 GB

lassemaatta11:07:06

(assuming those were the timings you were comparing)

borkdude11:07:41

thank you. that's similar to my macbook pro

dharrigan12:07:24

The thing to bear in mind here, is I assume since no graalvm is out yet with native arm64 support, then rosetta2 is having to translate on the fly.

dharrigan12:07:42

Since native aarch64 support isn't coming until JDK 17

dharrigan12:07:21

This one is formatted better

dharrigan13:07:49

It's defintely being translated on the fly. I was watching Activity Monitor and it reports Intel as the Kind. If it was native it would say Apple.

dharrigan13:07:06

A totally subjective heat test (by me placing my hand under the laptop during the compilation), made me think maybe 2 or so degrees warmer to compile. However, unlike Intel MBP's - my laptop is totally silent and doesn't sound like I'm standing beside a 747 about to take off.

borkdude13:07:16

true, my intel also behaves like a 747

dharrigan13:07:00

Personally, I think it's so amazing that it works to compile to a native image on aarch64, without me having to jump through hoops.

dharrigan13:07:07

It's a credit to the technologies in play!

dharrigan13:07:49

(not that the bb is native, i.e., aarch64, it's still an intel image - just that it's possible to do this!)

naomarik16:07:49

When I got my M1 Macbook I found performance varied enormously on the choice of java you were using. I settled on openjdk 1.8.0 zulu compiled for Mac aarch64.

👍 9
dharrigan17:07:23

Ditto, except, I use 16 🙂

Duco Ergo Sum17:07:52

Has anyone looked at https://github.com/PlummersSoftwareLLC/Primes with a view to creating a Clojure entry?

Duco Ergo Sum17:07:04

This is a prime numbers language comparison drag race for a bit of fun. Many languages are represented notably, Scala, Haskell, Lisp, FSharp, Elixir, Java and many more.

greg17:07:35

It might be a fun exercise indeed, but nothing beyond I'm afraid. I think it is worth to know it is no good to take part in every possible race. One must choose a race to take part in, and pass others. Clojure is not a language designed for computations, so signing up for a performance race, it is signing up knowing that you will get beaten 😬

Duco Ergo Sum18:07:22

Apologies, for the delayed response. I wasn't thinking that Clojure would out perform the whole field. I did think it would be fun to see where Clojure would fall out in among the other functional and or jvm based languages. Even if that is last. If you're wondering why not DIY it, my answer would be that to stand chance of providing a representative primes program then the developer would need to be someone with real world experience and strong subject matter knowledge.

sova-soars-the-sora19:07:23

I had a fun time thinking about primes and had to get up one night at 2 am with an algorithm in my head recently. https://replit.com/@sova2/PrimeSoup#main.clj It's pretty simple, it keeps a list of primes (a set) and for each new number it tries to divide it by the numbers in the set, and if it returns true it omits the number, if it returns all falses it adds it to the list, goes to the next number. It's certainly not as fast as the bit-sieve produced at the link above, but I find that it is quite readable 😃

sova-soars-the-sora18:07:41

What are some of your favorite coding challenges you've had in interviews?

Duco Ergo Sum18:07:35

Mine was to write a calculator app, that used RPN for its backend interpreter. That was admittedly many years ago.

sova-soars-the-sora19:07:21

That does sound like a fun challenge. Did it not take a while to do?

Duco Ergo Sum19:07:56

It did, but the language that the company used at the time was VB .Net 2 (Some dating information) and there was a good bit of time given to the task.

p-himik19:07:35

If you accept take home projects for an answer, mine was a concurrent task manager. One manager, multiple workers, tasks of different kinds (can be added during run-time), one worker switching between task of different kinds incurs a penalty - the goal is to plan all tasks in such a way so there's as little overhead as possible. Incidentally, it was also my first Clojure project. They told me to use any language I wanted, so I decided to go with the most potentially interesting one. I even have sources somewhere, although I haven't looked at them since - no idea how good the actual code is.

Thomas Segura10:07:00

hi, if you have the full text at hand I would be interested . thanks

sova-soars-the-sora19:07:28

That's a very intriguing challenge. So jobs were defined as a task with a time to run and stuff? Cool arrangement problem.

p-himik19:07:03

Without a predefined time, IIRC - each task just had some particular kind and length. Also, it was the only time I used STM. :D

seancorfield20:07:26

So far in my (nearly 40 year) career, only one company required a coding challenge in the interview and I walked out at that point. A couple of companies have wanted a design sketched out on a whiteboard but not actual code. My opinions on "coding challenges" are pretty well known here I think 🙂

👍 3
sova-soars-the-sora23:07:22

(def total-number-of-coding-challenges-participated 
  {:in-interview 2
   :upcoming-in-interview 1
   :take-home 2
   :upcoming-take-home 1})
nonzero. maybe i'll go back to putting code samples on my resume

greg23:07:51

TBH some of the companies had unrealistic demands. I used to apply back in 2015 to one of the companies utilising Cocos2d-x engine, an engine for making crossplatform mobile games. They knew I don't know the engine. The task was to build a simple game. "Here you have some resources, build something with it. It shouldn't take you more than 4h". I laugh now, but I spend about a week learning the framework and building a game (btw supporting 3 desktop platforms and 2 mobile). At the end they hired me, but seriously, this is not something that should be a norm. I mean, as long as it is fun to do a coding challenge I don't mind spending some time on it, but generally I think this is not something that should be a norm. If it takes a few hours, you should be paid for it.

greg23:07:23

Some of the coding challenges that are not too bad, are these taking up to 20 minutes during the f2f interview. You sit with the hiring company dev, or maybe even pair program with him/her, and you take and solve together some abstract problem, or debug & solve some bug. It doesn't take much time, and it is more social, and even if they don't hire you, you have the opportunity to learn something from that dev. Win win.

Stuart23:07:42

I had a day of ups and downs today, literally. First this happened on a hike: I sunk past my knees in a bog, it wasn't deep at all but then one step and all of a sudden I sunk 😞 Cue hours of wet feet and being miserable and my camera covered in mud. At least there was a stream I was able to clean off in, but no towel... Lesson learnt, in the future take change of socks and a towel and some wet wipes. But then it was worth it to see this: https://flic.kr/s/aHsmWgATue The views were spectacular, seeing the peaks rise of out of the clouds.

🥾 6
😄 3
dpsutton01:07:50

What hat is that? I’ve seen that logo associated with Michael Schumacher for years but never actually knew what it is

Stuart01:07:57

it's a Michael Schumacher hat

dpsutton02:07:53

ah ok. i always thought he had a special endorsement deal with that company

dpsutton02:07:59

didn't realize it was just his brand

Stuart11:07:54

The writing says "Deutsche Vermgonsberaterung", which is apparely a German financial company. So they must have been his sponsor.