User avatar
Gavinmc42
Posts: 4556
Joined: Wed Aug 28, 2013 3:31 am

Re: Pi4 as Desktop computer

Sat Nov 16, 2019 8:33 am

7-9 fps on Chromium on Gentoo64, 5-6fps Aurora, but it is screen size dependant, got as high as 20fps at 640? width.
But I was compiling the Fifth browser dependences at the same time, that does not do WebGL.

How much faster can browsers go on Pi4's?
A stand-alone WebGL/glTF viewer will go faster or are browsers better optimized now?
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

Heater
Posts: 16332
Joined: Tue Jul 17, 2012 3:02 pm

Re: Pi4 as Desktop computer

Sat Nov 16, 2019 9:04 am

Browsers get their optimization honed everyday. Modern day JS interpreters are a couple of orders of magnitude faster than they were some years ago. Not up to the speed of compiled C but doing very well.

That V8 engine simulation uses webgl of course but it is primarily a demo of the babylon.js 3D library my Microsoft. Babylon is a very nice library to make working with webgl a lot simpler. Babylon.js is written in Javascript so the speed of the JS interpreter has a huge impact on it's performance.
Memory in C++ is a leaky abstraction .

User avatar
clicky
Posts: 499
Joined: Thu Oct 25, 2012 7:34 am

Re: Pi4 as Desktop computer

Sat Nov 16, 2019 9:44 am

And now you lost me with that JS WebGL (performance) test.

My Pi4 is averaging 4fps and in full screen from Chromium only 3fps.
But, of course - that's, along with other 7fps/9fps, etc, just partial information which doesn't help a lot.

My screen resolution is 2560x1600. On 1920x1080 it is 7fps and on 1024x768 11fps (full screen mode 10fps). If I make smaller window I can make it run up 14fps...

Also, I've double check CPU if it wasn't reaching 25% (one full core) - it was around 10-14%, so all the about talk 32bit or 64bin OS or speed of JS makes no sense. All is due GPU and those are fps I observed with my game, too...

BTW when I made tiny window to achieve 25fps (where JS side would add more CPU) it pushed CPU usage to around 30%...

User avatar
Gavinmc42
Posts: 4556
Joined: Wed Aug 28, 2013 3:31 am

Re: Pi4 as Desktop computer

Sat Nov 16, 2019 10:28 am

Anyone with a 4K screen, what fps is that doing?
So what is the speed limiter for WebGL?

Is it GPU memory speed, JS, JIT, does not seem to be CPU speed?
But I have read the browsers are using more cores if they are there.
I click on a new tab and the 4 cpu bars go up.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

Heater
Posts: 16332
Joined: Tue Jul 17, 2012 3:02 pm

Re: Pi4 as Desktop computer

Sat Nov 16, 2019 10:35 am

That's an interesting result clicky. Certainly seems to be the GPU that is the bottleneck.

Despite what everyone, everywhere says all the time, Javascript is not the problem in browsers.

2560x1600.is of course ludicrous resolution for this. Even in a full screen window I would expect the frame rate to go up a lot if you zoom into some small area and there is less action to render.

Probably a model with less level of detail and simpler lighting effects etc would get the speed up to something respectable.
Memory in C++ is a leaky abstraction .

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 26876
Joined: Sat Jul 30, 2011 7:41 pm

Re: Pi4 as Desktop computer

Sat Nov 16, 2019 10:40 am

4K resolution in 3D is a massive ask for GPU even a desktop one. We quadrupled speed in the V6 over the vc4 but that only means you'll get the same frame rates at 4K that we previously got at 1080p.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

User avatar
clicky
Posts: 499
Joined: Thu Oct 25, 2012 7:34 am

Re: Pi4 as Desktop computer

Sat Nov 16, 2019 11:29 am

Heater wrote:
Sat Nov 16, 2019 10:35 am
That's an interesting result clicky. Certainly seems to be the GPU that is the bottleneck.

Despite what everyone, everywhere says all the time, Javascript is not the problem in browsers.
It really depends what you're using it for. In this instance CPU is relatively lightly used - a few calculations here and there and for orchestrating GPU. It is similar with Python - you can use Python as light weight wrapper over C/C++ code that can do much lower, byte level processing. But if you try to use it on byte level - it is completely inappropriate. Ask me how I know :roll:
Heater wrote:
Sat Nov 16, 2019 10:35 am
2560x1600.is of course ludicrous resolution for this. Even in a full screen window I would expect the frame rate to go up a lot if you zoom into some small area and there is less action to render.
Me, too, but - if it is GPU intensive (and it is!) then making it full screen only adds more pixels to be processed and I suspect that's what we've seen there...

User avatar
Gavinmc42
Posts: 4556
Joined: Wed Aug 28, 2013 3:31 am

Re: Pi4 as Desktop computer

Sat Nov 16, 2019 11:40 am

So a good coding challenge would be a 3D app or game that renders at 60fps at 4K?
Is it possible?
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

User avatar
clicky
Posts: 499
Joined: Thu Oct 25, 2012 7:34 am

Re: Pi4 as Desktop computer

Sun Nov 17, 2019 11:36 am

Gavinmc42 wrote:
Sat Nov 16, 2019 11:40 am
So a good coding challenge would be a 3D app or game that renders at 60fps at 4K?
Is it possible?
Depends how simple you make it. It might be possible:

https://www.youtube.com/watch?v=8q9RJtG ... e=youtu.be

Here is thing I am working on. It has really small number of polygons but uses several passes in order to calculate shadows. I've got following results:

800x600 windowed mode - 60fps easily
1024x768 windowed mode - 47 - 50 (mostly 50) fps
1280x720 windowed mode - ~ 43fps

2560x1600 full screen mode - 22fps
1280x960 full screen - 45-50fps
1280x720 full screen - 55 - 60fps (mostly 60)
1024x768 full screen - 70 fps

PS video is made on mac but I timed it on RPi4... I can give it a go without shadows - I'm sure it would run better...

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 26876
Joined: Sat Jul 30, 2011 7:41 pm

Re: Pi4 as Desktop computer

Sun Nov 17, 2019 3:26 pm

Neverball runs OK at 4K IRC, that is what we use for testing (amongst other things).
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 26876
Joined: Sat Jul 30, 2011 7:41 pm

Re: Pi4 as Desktop computer

Sun Nov 17, 2019 3:27 pm

Heater wrote:
Sat Nov 16, 2019 10:35 am
Despite what everyone, everywhere says all the time, Javascript is not the problem in browsers.
Yes it is. 'Everyone' cannot all be wrong.

It's not the only problem though.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

Heater
Posts: 16332
Joined: Tue Jul 17, 2012 3:02 pm

Re: Pi4 as Desktop computer

Sun Nov 17, 2019 4:30 pm

jamesh,
'Everyone' cannot all be wrong.
Sure they can. As was said in a Monty Python sketch: "99 percent of all right thinking people are wrong!"
Yes it is.
No it is not.

Javascript is just a programming language, a rather sophisticated, efficient and good language as it happens. "Universal" as Turing would have it. That is to say logically equivalent to Python, C++, Go, take your pick.

Therefore, if we accept that having a universal programming language in the browser at all is a good idea then we see that Javascript is no more the problem than if that language had been Python, C++, Go, take your pick.

Everyone rags on JS but if it were any other language in the browser all the same problems would exist. It is not Javascript's fault! Blaming Javascript is not right and not fair.
It's not the only problem though.
That is is certainly true. The more I have been working with "web stuff" in recent years the more I became convinced that the environment that JS lives in in the browser has been deigned for maximum insecurity from the ground up!

With care and effort one can disable a lot of bad stuff now a days when putting together a web site. But really why it's not all disabled by default is beyond me.

If Facebook and the like insist on sending tens of megabytes of JS down the line that takes forever to load and parse and eats all your memory that is not Javascript's fault. They would have done that in any other language.

As we will soon find out with the arrival of webasm. Which allows almost any language to be compiled into byte codes and sent to your browser.
Memory in C++ is a leaky abstraction .

User avatar
dickon
Posts: 1661
Joined: Sun Dec 09, 2012 3:54 pm
Location: Home, just outside Reading

Re: Pi4 as Desktop computer

Sun Nov 17, 2019 5:29 pm

Heater wrote:
Sun Nov 17, 2019 4:30 pm
Therefore, if we accept that having a universal programming language in the browser at all is a good idea [...]
If. That's a *huge* if.

Personally, I don't think it is, but I do recognise that that ship has sailed, and we just have to get used to it. Installing NoScript and setting it to reject everything by default is instructive. You will find a: everything runs much, much faster (as there's no JavaScript running, so you just get a basic rendering), b: your ad blocker is more effective (as there's no ad-reinjection attempted by the website, running JavaScript), and c: a lot of things break (as the site relies on the scripting engine running the scripts).

But simply blacklisting all the analytics guff that every website seems to feel is an absolute requirement these days makes a notable improvement. Knocking out all the crap the ad networks inject is also a huge win.

Heater
Posts: 16332
Joined: Tue Jul 17, 2012 3:02 pm

Re: Pi4 as Desktop computer

Sun Nov 17, 2019 5:52 pm

dickon,
If. That's a *huge* if.
I thought somebody would pick up on that.

I can kinda, sorta agree with you.

As it happens I don't suffer from adds much. If I ever find myself linked to a page that is busy downloading tons of adds the back button is only an instant away. Likely any content it had is not worth the effort, I tell myself. Often the content is available somewhere less obnoxious.

I do like that a page in my browser running JS and other code from my web server is so convenient. Browser and server are just an application program of mine with different parts running at different ends of the line. A web page makes a nice, cross platform and remotely usable GUI.
Memory in C++ is a leaky abstraction .

User avatar
dickon
Posts: 1661
Joined: Sun Dec 09, 2012 3:54 pm
Location: Home, just outside Reading

Re: Pi4 as Desktop computer

Sun Nov 17, 2019 6:37 pm

I thought you might. It was phrased as a bit of a challenge.

I suspect jamesh feels similarly to the way I do: JS is an inconvenience at best, and a huge problem at worst.

When people are doing benign things with it -- and I've done so myself -- it's great: it's a handy way of validating fields before submitting them to a backend for processing, or designing highly reactive interfaces which don't require a full page-load each time you change state. I like things like that, but sites should work without it.

When people are doing malign things with it -- and I've never done this -- it's a nightmare: it's a handy way of tracking a user's mouse position, setting cross-domain cookies, reporting back to a server on what the user is doing, where they've been, and assigning unique identifiers based on a fingerprint of the browser and window. And that's just the easy stuff: coin-mining, VM breakouts (to infect the host process), covert data collection, side-channel inter-process snooping -- all this has been done and isn't theoretical. I hate things like that, and sites must work without it.

JS is a nightmare. Causes horrendous problems, and, on an ideal planet, wouldn't exist. It's mostly lazy developers which require it, and although there are some really nice tricks which make running it worthwhile, on the whole it's more trouble than it's worth.

Heater
Posts: 16332
Joined: Tue Jul 17, 2012 3:02 pm

Re: Pi4 as Desktop computer

Sun Nov 17, 2019 8:20 pm

dickon,
JS is an inconvenience at best, and a huge problem at worst.
I don't disagree with the thrust of your argument there. But I would say that when JS is used on the good end of the scale of things it is no inconvenience. After all, it's only some bytes of text to load and it will use a little processing power and memory. How is that worse than the same using CSS, or SVG, or images and so on. It hardly shows up in the noise.
When people are doing malign things with it ...
Of course I'm aware of all the nightmares you mention. There's likely more I/we are not aware of. After all who knew JS could pull off timing related side channel attacks until recently?
JS is a nightmare. Causes horrendous problems, and, on an ideal planet, wouldn't exist
There. You did it again.

It's not the fault of Javascript the language. Imagine for a moment Javascript had never been invented. Instead they just adopted some exiting language to use for scripting in the browser, say Python or Perl or whatever. Then you would have to say "Python is a nightmare. Causes horrendous problems, and, on an ideal planet, wouldn't exist"

Clearly JS is innocent. The problem is the leaky environment the language runs in and the powers it is granted. And by extension the powers it grants to all manner of unknown third parties.

Blaming it all on JS diverts attention from all the real problems of the browser.

Remember 1 pixel images used for tracking people? Well, why when I visit a web site that I think I can trust is my browser allowing image fetches from,or any connection to, other web sites I have never heard of without my permission?

Cookies - Why is by browser sending cookies anywhere that do not know about and without my permission?

User agent strings - Since when did I give my permission for such information to be publicized?

I could go on. Of course having a universal language in the browser can amplify all these problems and more. But there are tons of ways you can be tracked without.
Memory in C++ is a leaky abstraction .

User avatar
dickon
Posts: 1661
Joined: Sun Dec 09, 2012 3:54 pm
Location: Home, just outside Reading

Re: Pi4 as Desktop computer

Sun Nov 17, 2019 8:48 pm

JS is still a problem, even in 'good' contexts. Mostly because the browser is tasked with determining between the good and bad, and often fails. Now, you're right: it isn't JS I'm actually complaining about. The language has enough serious issues with it that mean it should never have seen the light of day, and an alternative really should have been chosen, IMHO. That said, I'm not sure what options were available back then.

That said, JS isn't 'innocent'. The design of it is a mess. Just compare the O'Reilly tomes 'JavaScript: the Definitive Guide' and 'JavaScript: the Good Bits'. JS:tGB is about 10% of the size of JS:tDG...

But scripting language in browsers: on the whole, a terrible idea with a few good applications, and a whole shedload of really, really bad ones. The reality we live in means the bad ones are the ones that are written.

Heater
Posts: 16332
Joined: Tue Jul 17, 2012 3:02 pm

Re: Pi4 as Desktop computer

Sun Nov 17, 2019 10:05 pm

dickon,
The design of it is a mess.
I don't believe it is. I can point to bigger messes. For example Perl, Python, C++.
Javascript is positively svelte and well organized by comparison.

Why do people like to hate on Javascript so much? What "serious issues" ?

Javascript is a modern, sophisticated language having always had features that languages like C++, Python, etc only acquired recently: For example, first class functions, lambda functions, closures, asynchronous programming.

It is one hundred percent an event driven programming model. Ideal for those mouse click handlers in browsers. Turns out to also be idea for event driven handling of all kind of connections to sockets, serial ports, databases, etc.

That event driven model is especially useful when you have to juggle many connections to sockets, databases, serial ports etc in node.js. Makes programming it all much easier than using threads and some thread library.

It's efficient when you have thousands of connections and transactions in flight at the same time.

Sure it's dynamically typed. As are many scripting languages.

Sure it has some weird type coercions. But then so does C and C++ where they are likely more dangerous.

All languages have those "bad parts" that you had better be aware of. At least in Javascript they are not usually as dangerous as the undefined behaviors of C/C++, which by the way cause 70% of security vulnerabilities in the world today.

In practice the "bad parts" of Javascript do not cause much problem. And when you are familiar with the language you don't do that.
Memory in C++ is a leaky abstraction .

Heater
Posts: 16332
Joined: Tue Jul 17, 2012 3:02 pm

Re: Pi4 as Desktop computer

Sun Nov 17, 2019 10:13 pm

dickon,
...an alternative really should have been chosen, IMHO. That said, I'm not sure what options were available back then.
An alternative was available. It was Java. Run as Java Applets in the browser.

Java Applets were a dismal failure because Java is an even worse language, they were slow, security was terrible.

Also in 1996 came ActiveX controls from Microsoft. An even worse idea, with even worse security implications. Imagine Visual Basic embedded in web pages!

Be grateful the world said no and went with Javascript instead.
Memory in C++ is a leaky abstraction .

User avatar
clicky
Posts: 499
Joined: Thu Oct 25, 2012 7:34 am

Re: Pi4 as Desktop computer

Mon Nov 18, 2019 10:31 am

Heater wrote:
Sun Nov 17, 2019 10:13 pm
Java Applets were a dismal failure because Java is an even worse language, they were slow, security was terrible.
ROFL. Is this some kind of flame war or just place where people pass their (uneducated?) opinions as facts? :P

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 26876
Joined: Sat Jul 30, 2011 7:41 pm

Re: Pi4 as Desktop computer

Mon Nov 18, 2019 10:42 am

It's now an language ex-flame war .

Shame that this relatively constructive thread has fallen to the language zealots. Might bring in the ban hammer later once I've had a nice hot chocolate.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

Return to “General discussion”