News for hackers. Stuff that matters.
Re:Show HN: 300k lines of Java UI code running native in bro... by lasagnaphil on Friday April 05, 2019 @08:41AM (#19581915)
No, this is definitely not running at desktop speeds. I have a Ryzen 7 2700, and this thing lags often even with basic UI operations (clicking buttons and menus, dragging objects). Now imagine someone with a dual-core laptop CPU... this will be even worse. It certainly feels like this is a web app rather than a native one.
Re:Show HN: 300k lines of Java UI code running native in bro... by dziulius on Friday April 05, 2019 @09:42AM (#19582374)
Well, it's written in Java, so desktop app probably lags as much. So title does not lie :D
Re:Show HN: 300k lines of Java UI code running native in bro... by jeffreportmill1 on Friday April 05, 2019 @10:09AM (#19582631)
Now that hurts :-). Java has been pretty amazing for many years. Many Java desktop apps ran poorly because they were written poorly.

I used to give demos of the Swing version of this app 15 years ago, and people would try to convince me that my app was written in C, because a Java app can't run that fast. Those were weird conversations. I'm not even that clever - I just try to write simple code.

Re:Show HN: 300k lines of Java UI code running native in bro... by ixtli on Friday April 05, 2019 @10:21AM (#19582759)
This is my experience with java > 7. The JVM with default settings is pretty excellent these days (see JetBrains IDEs: they're MASSIVE but they run just as well as any other native desktop app.) The issue as far as i see it is that the "enterprise" way of thinking that has and still does dominate the majority of development that results in java code is so bad that it starts to seem like its the language/runtime.
Re:Show HN: 300k lines of Java UI code running native in bro... by garaetjjte on Friday April 05, 2019 @06:05PM (#19587473)
>they're MASSIVE but they run just as well as any other native desktop app

Not for me. They're starting up long, UI is laggy. In comprasion to native IDE like Qt Creator they're really slow.

Re:Show HN: 300k lines of Java UI code running native in bro... by Yoric on Friday April 05, 2019 @10:23AM (#19582784)
I used to write apps with Swing nearly 20 years ago (before javax), and making even simple apps perform without tearing and atrocious performance was really, really hard.

Fortunately, CPUs have caught up with Java, eventually :)

Re:Show HN: 300k lines of Java UI code running native in bro... by ww520 on Friday April 05, 2019 @02:06PM (#19585375)
In my experience Java beats most languages out there in the speed department.
Re:Show HN: 300k lines of Java UI code running native in bro... by dziulius on Tuesday April 09, 2019 @04:25AM (#19612764)
I'm not arguing about server side java apps. But java UI apps is still trash.
Re:Show HN: 300k lines of Java UI code running native in bro... by eweise on Friday April 05, 2019 @03:51PM (#19586348)
You forgot to add the date of your post

"Well, it's written in Java, so desktop app probably lags as much. So title does not lie (2001)"

Re:Show HN: 300k lines of Java UI code running native in bro... by dziulius on Tuesday April 09, 2019 @04:24AM (#19612761)
Right, now computers come with 4+ cores, so it does not lag as much.
Re:Show HN: 300k lines of Java UI code running native in bro... by BoorishBears on Friday April 05, 2019 @10:04AM (#19582583)
It runs at native speed on my iPhone. Sounds like your browser has an issue...
Re:Show HN: 300k lines of Java UI code running native in bro... by macspoofing on Friday April 05, 2019 @06:24PM (#19587584)
No. Not quite. Framerate for me oscillates between 12-30fps (2018 XPS 15 laptop). It's quite usable but not 'desktop speed'.
Re:Show HN: 300k lines of Java UI code running native in bro... by BoorishBears on Friday April 05, 2019 @07:50PM (#19588146)
What browser?
Re:Show HN: 300k lines of Java UI code running native in bro... by jeffreportmill1 on Friday April 05, 2019 @08:48AM (#19581963)
I get desktop speed for Chrome, Safari, but FireFox does lag for me. The first run does load various UI files on demand, but once cached, most delays go away.
Re:Show HN: 300k lines of Java UI code running native in bro... by TeMPOraL on Friday April 05, 2019 @09:36AM (#19582321)
Yeah, what's up with that? I use Firefox a lot, and I've noticed it always has poor performance on heavy JS apps. The off time I need one of such apps is the only reason I keep Chrome installed on my system.
Re:Show HN: 300k lines of Java UI code running native in bro... by kbenson on Friday April 05, 2019 @09:56AM (#19582500)
I've noticed that too. I think it might be that these days "idiomatic high-performance JS" might just be another way of saying "makes use of Chrome's quirks, strengths and optimizations". I imagine there's some things Firefox just can't do quite as fast as Chrome because of design decisions. The reverse probably also holds true, but that doesn't help as much if you aren't the market leader.
Re:Show HN: 300k lines of Java UI code running native in bro... by StavrosK on Friday April 05, 2019 @11:56AM (#19583766)
Yeah, basically "we made this run fast on Chrome".
Re:Show HN: 300k lines of Java UI code running native in bro... by fastball on Friday April 05, 2019 @10:05AM (#19582594)
Chrome's JS engine is optimized for real-word usage.

FF's is not.

Re:Show HN: 300k lines of Java UI code running native in bro... by Yoric on Friday April 05, 2019 @10:21AM (#19582761)
As a member of the Mozilla JS team, let me tell you that we're working on optimizing our engine for real-world usage all the time.

Some optimizations are better in SpiderMonkey than in v8, some are worse. Unfortunately, whenever a web developer optimizes solely for v8/Chrome, this hurts Firefox.

Re:Show HN: 300k lines of Java UI code running native in bro... by Klathmon on Friday April 05, 2019 @12:02PM (#19583828)
This might be a lot to ask of a random internet comment, but is there anything common you tend to see in apps that make them look/feel overtuned to v8?

I'll freely admit that i'm guilty of the "develop for chrome, test in firefox" kind of workflow, and I really want to improve on that. I feel like I have built up a kind of "intuition" about what works well and what doesn't over the years in chrome, and i'd like to start building that up for other browsers.

Re:Show HN: 300k lines of Java UI code running native in bro... by mi100hael on Friday April 05, 2019 @02:08PM (#19585392)
I'd guess a lot of that sort of optimization happens at the framework/library level (React, Emscripten, etc) and less so in your typical application code.
Re:Show HN: 300k lines of Java UI code running native in bro... by fastball on Friday April 05, 2019 @12:09PM (#19583902)
I have never once "optimized solely for V8" (I honestly have no idea what runs better in Chrome vs. Firefox).

All I know is that I build an app as I think makes sense logically, and 100% of the time it runs faster / less hot in Chrome.

JS-heavy apps burn thru CPU cycles far more on FF than in Chrome.

I want to use FF as my daily driver, I really do. But it's real-world performance just doesn't cut it for me, and I don't think you can blame that on people "solely optimizing for Chrome", as V8 was a better engine at the moment of release, when nobody had had a chance to optimize for it.

Re:Show HN: 300k lines of Java UI code running native in bro... by kbenson on Friday April 05, 2019 @12:47PM (#19584417)
Do you develop and test using Chrome, or Firefox, or both? If you aren't testing in Firefox beyond "it displays correctly" but you are using Chrome for your normal development, and testing, you are de-facto optimizing for Chrome, because you'll notice slowness in Chrome and work around if, but that same thing may have been fast in Firefox, but you never noticed. That's what being the market leading browser grants them.
Re:Show HN: 300k lines of Java UI code running native in bro... by bzbarsky on Monday April 08, 2019 @04:44PM (#19608835)
Do you happen to have a link to a specific thing you built that runs faster in Chrome? I'd love to take a look at what's going on there...
Re:Show HN: 300k lines of Java UI code running native in bro... by Spivak on Friday April 05, 2019 @10:22AM (#19582771)
Real-world JS is optimized for V8.
Re:Show HN: 300k lines of Java UI code running native in bro... by fastball on Friday April 05, 2019 @12:07PM (#19583885)
Except you're reversing the order of the chicken and egg.

Real-world JS was already in production when V8 was released, and it had orders of magnitude better performance at the time.

Re:Show HN: 300k lines of Java UI code running native in bro... by Spivak on Friday April 05, 2019 @02:15PM (#19585455)
I don't disagree at all, V8 was and still is revolutionary. However, the second order effect of V8 having captured such a large portion of the market is that developers will code/tweak/optimize until their app/library is suitably performant on V8 and then stop. No value judgement, it's totally rational but the effect is that now a lot of JS code has an implicit dependency on the quirks of V8 in order to be fast.

There's really no good solution to this because the kind of performance tuning we're talking about explicitly pierces veil the VM is supposed to provide. You're pretty much always going to target the internals of one particular engine. So what this means is that anyone working on a competing engine not only has to provide the same behavior but also the same performance profile because it's something that JS devs expect to be there now.

Re:Show HN: 300k lines of Java UI code running native in bro... by 93s6oz on Friday April 05, 2019 @09:49AM (#19582433)
Firefox has worse performance than Chrome overall, despite what their synthetic benchmarks might say.
Re:Show HN: 300k lines of Java UI code running native in bro... by vardump on Friday April 05, 2019 @10:20AM (#19582749)
That probably has nothing to do that everyone is now optimizing for Chrome.
Re:Show HN: 300k lines of Java UI code running native in bro... by ionised on Friday April 05, 2019 @09:52AM (#19582457)
How are you measuring 'overall'?
Re:Show HN: 300k lines of Java UI code running native in bro... by 93s6oz on Friday April 05, 2019 @09:54AM (#19582477)
I am not measuring it, that's the point. Synthetic benchmarks are useless when real life experience shows the opposite.
Re:Show HN: 300k lines of Java UI code running native in bro... by xori on Friday April 05, 2019 @10:06AM (#19582597)
As an enlightened individual as I'm sure you are, we strive to remove personal bias when possible. This includes measuring statistics. Which can take the form of synthetic benchmarks, but also real life tests, like page load times of notoriously bad news sites, or heavy cpu bound tasks like image resizing in the browser.
Re:Show HN: 300k lines of Java UI code running native in bro... by ionised on Friday April 05, 2019 @11:22AM (#19583415)
If you're not measuring it then it's pretty much subjective, no? You can't quantify what you don't measure.

I don't know how you use Firefox and Chrome (I use both in work) but they behave pretty much identically as far as I can tell, once ads and other crap have been blocked.

The only difference is Chrome is snappier on Google sites and seems to use double the memory to open the same tabs.

Re:Show HN: 300k lines of Java UI code running native in bro... by dosy on Friday April 05, 2019 @10:01AM (#19582550)
I'm running on a surface. Seems fine.