Chrome lighthouse score gives poor scores on different systems - audit

We are using chrome lighthouse extension for running tests on our pages and improves performances score. We have however a problem. On a MacBook Pro-2015, we get a 94 performance score and also 94 performance score in a Windows virtual machine running on the laptop. However on a 64-bit Windows laptop with an Intel Pentium n3540 CPU, we get below 50. Even demo pages found online that claim 90+ score will not go above 50 on this system.
Are there any specific requirements that the lighthouse has in order to run correctly? Or some special settings need to be done on the Windows system?

Lighthouse can be configured to run on most systems, nothing precludes it from running on windows (it should run on windows out of the box), but there will definitely be variation based on the system that it runs on un-throttled. If you want a consistent bar to run against consider running against WebPageTest. Or play with their custom settings to get an audit that is exactly what you want that can be run consistently.
I think that running lighthouse on a computer with a chip that was released 4 years ago will probably yield low results, as you are experiencing. Which is probably an accurate depiction of how performant a website will be on that hardware. This might be a case of WAI.
Are you running Lighthouse with simulated throttling, or with throttling off? That can also increase variation.

Related

Poor performance of web app built with ArGIS API for JS on older hardware

Problem
I've been developing a web application for the first time using the JS API. When testing the performance of the website, I've had perfectly snappy use on relatively new hardware (such as my Surface Laptop 3 8GB RAM, Chrome v88) but cripplingly slow use on somewhat older hardware (MacBook Pro 13" 2016 8GB RAM, MacBook Pro 15" 2014 8GB RAM, Dell Inspiron 15 5000 2017 8GB RAM, all running Chrome v88).
Link to web app in development:
https://dmarkbreiter.github.io/lau-interactive/
Troubleshooting
Considering how these "older" hardware configs aren't very old, the laggy performance is troubling. At first I thought it might be a basemap or feature service that was slowing down the application, but when I tested sample apps on the developer page for the API, I had equally if not slower performance.
Example apps linked below:
https://developers.arcgis.com/javascript/latest/sample-code/featurelayer-query/
https://esri.github.io/dot-density-legend/
https://livingatlas.arcgis.com/sea-ice/
The above apps work perfectly fine on my Surface Laptop 3, but absolutely limp along on the other tested hardware configs.
UPDATE
Looking at my own app, I see that two feature services (LAU_Localities_View and SoCal_Counties) have multiple GET requests at page load. I've included the Query String Parameters of one of them below:
f: pbf
geometry: {"spatialReference":{"latestWkid":3857,"wkid":102100},"xmin":-13149614.849954996,"ymin":3757032.814274987,"xmax":-12993071.816026995,"ymax":3913575.8482029866}
maxRecordCountFactor: 3
resultOffset: 0
resultRecordCount: 8000
where: 1=1
orderByFields: OBJECTID ASC
outFields: OBJECTID
outSR: 102100
quantizationParameters: {"extent":{"spatialReference":{"latestWkid":3857,"wkid":102100},"xmin":-13149614.849954996,"ymin":3757032.814274987,"xmax":-12993071.816026995,"ymax":3913575.8482029866},"mode":"view","originPosition":"upperLeft","tolerance":305.74811314062526}
resultType: tile
spatialRel: esriSpatialRelIntersects
geometryType: esriGeometryEnvelope
inSR: 102100
The first thing that strikes me as weird is the low maxRecordCountFactor of 3.
Question
Is this the expected behavior/performance of web applications built using the API?
If not, how can I make my application more performant on a variety of hardware configs? Even panning around a basemap feels and looks choppy on this hardware. Is this a known issue and if so, is there any workaround to ensure useable performance on a variety of hardware?
It would appear that the issue is with Esri's WebGl engine and it not working with the machine's graphics driver as evidenced by the following console warning on Chrome based browsers:
[esri.views.2d.engine.webgl.WebGLDriverTest] A problem was detected with your graphics driver. Your driver does not appear to honor sampler precision specifiers, which may result in rendering issues due to numerical instability. We recommend ensuring that your drivers have been updated to the latest version. Applying lowp sampler workaround. [0.0.0.0]
When the web apps linked in the question were tested on FireFox 86, they worked perfectly fine and without the warning above.

Virtualize specific environment (CPU, cache, clock)

I have written some code that's supposed to run on a certain hardware-setup. I'd like to test it to get some preliminary metrics, but without buying the hardware setup, since it's very expensive.
At first I, naively, thought I could set some specifications to the platform when creating a virtual machine through a manager such as VMware Workstation, but it seems like it's not possible.
What ways do you believe would be the best to emulate a certain environment? Of course, RAM, disk space and OS should be fairly easy, but limiting the CPU seems to be the general issue.
I'm trying to simulate the Intel AtomĀ® Processor E3845, so I have some requirements to the maximum cores, cache size and of course the clock frequency.
The closest I've found so far would be to install WMware ESXi on a piece of hardware and limit the CPU. But I'm unsure if this is the best way. Further, I've never really worked with this before, why I'm unsure if I can limit the cache and so forth. Simply "down-scaling" the metrics does not feel like a good solution when we are rather dependant on the cache (that is, we've seen issues with certain sizes and speeds).
I Would love to hear some inputs if you have any.

How to test applications and websites with less computing power?

Currently I develop on an extremely powerful machine: Pentium i7, 32 GB Ram, SSD, 1 Gb 1028-bit graphics card, etc.
What I'm trying to figure out is the proper way to test my applications and web pages simulating a less powerful computer. Is there any way to simulate a slower processor, less ram, slower hard drive, and weaker graphics card? I'm not sure if I missed anything else in terms of what else to simulate...
The only thing I've figured out so far is resolution, but that was as easy as changing my monitor resolution. Though, if there is a way to simulate less resolution without needing to change my actual screen resolution as well, that'd be great.
Download Windows Virtual PC.
And test you application in it. You can customize your configuration, everything like disk storage, ram memory etc.
Good application for application developers to test in different environments.
I suppose you could create a virtual machine on your computer. You could then vary how much RAM & processing power it has access to. You could boot this machine of a USB drive if you wanted to simulate a slower drive.

Basic virtualization questions

Excuse me for my lack of knowledge but I am really new to the Virtual world and have a few questions.
I work for a small charity who specialise in providing basic IT training. We have recently acquired a few Dell Poweredge 2650 servers and Dell desktops and we wish to offer both XP, Windows 7, Mac and Ubuntu training. I am looking at setting up a Virtual environment so that we can have a standard image for each OS (I currently use image files but it currently takes approximately 25mins to build each machine and multi-boot is not an option as the new machines have 20Gb disks).
The servers are all dual processor and we can purchase more memory(I need to justify the cost)
What are the memory requirements for
the Host?
How many VM's can I run
per server?
Can I run multiple instances of the same VM
Thanks in advance for your knowledge.
Darryn
You might be able to get away with a multi-boot option with those 20 gig disks; each OS will probably take no more than ten gigs for minimal installs, two OSes per machine isn't terrible. (Incidentally, look around for a group like FreeGeek in your area -- larger hard drives ought to be cheap for small sizes like 120-500 gigs.)
That said, virtualization might be just what you need, if you have a handful of pretty powerful machines.
I think between one and two gigabytes of host memory for every guest VM that you want to run would be very useful. At least in my experience, an Ubuntu image I gave 1024 megabytes to ran very quickly, but I didn't press it very far. Running Firefox or OpenOffice inside the VM would probably dictate more memory very quickly. Chrome seemed snappy.
So, if you've got 12 gigabytes of RAM, you might be able to get between four and twenty virtual machines hosted on the machine simultaneously, depending upon what your guests are doing.
As for disk space, if you use QEMU's -snapshot option, you ought to be able to save disk space. Each user could boot the same underlying disk image, but their own modifications would go into the 'snapshot' file. (I have no experience trying to do long-term system maintenance with this option, so it could be that all twenty of your users need to store service pack 2 contents when they upgrade in the future; I'd be scared of trying to modify the shared disk image once you've got snapshots of it running. Perhaps having everyone store 'personal documents' and the like in CIFS shares would make a ton of sense.)
The biggest hurdle will probably be Mac; because the Apple terms of service forbid running OS X on non-Apple hardware, you'll have to have some Apple machines around to run VirtualBox.

How To Simulate Lower CPU Processor Machines For Browser Testing

We have some users which are using lower-CPU powered machines and they're encountering slow response times using our web application. Is there any way for me to do testing so that I can simulate lower CPU rates?
For example, I have 2.3 Ghz computing power, can I lower it to 1.6 Ghz or lower so that I may be able to test it?
BTW, our customers are using Windows. I have to simulate low computing power on Internet Explorer as browser.
Most new CPUs multiplier can easily be lowered (Intel: Speedstep, AMD: PowerNow!). This is used to save power. With RMclock you can manually adjust your multiplier and thus lower your frequency and make your pc slower. I use this tool myself so I can tell you that it works.
http://cpu.rightmark.org/products/rmclock.shtml
The virtual machine Bochs(pronounced boxes) allows you to set a instructions per second directive. It's probably the slowest emulator out there as it is though...
Create some virtual machines.
You can use VirtualPC or VirtualBox both are free.
I would recommend to start something on the background which eats up all your processor cycles.
A program which finds primenumbers or something similar.
Another slight option in addition to those above is to boot windows in a lower resource config. Go to the start menu,, select run and type MSCONFIG. You can go to the boot tab, click on advanced options and limit the memory and number of of processsors. It's not as robust as the above, but it does give you another option.
Lowering the CPU clock doesn't always give expected results.
Newer CPUs feature architecture improvements which make them more efficient on an equvialent clock basis than older chips. Incidentally, because of this virtual machines are a bad way of testing performance for "older" tech as well.
Your best bet is to simply buy a couple of older machines. Using similar RAM (types and amounts), processor, motherboard chipsets, hard drives, and video cards. All of which feed into the total performance of the machine itself.
I bring the other components up because changing just one of them can have an impact on even browser performance. A prime example is memory. If your clients are constrained to something like 512MB of RAM, the machines could be performing a lot of hard drive access for VM swaps, even for just running the browser. In this situation downgrading the clock speed on your processor while still retaining your 2GB (assuming) of RAM would still not perform anywhere near the same even if everything else was equal.
Isak Savo'sanswer works, but can be a bit finicky, as the modern tpl is going to try and limit cpu load as much as possible. When I tested it out, It was hard (though possible with some testing) to consistently get the types of cpu usages I wanted.
Then I remembered, http://www.cpukiller.com/, which does this already. Highly recommended. As an aside, I found this util from playing old 90s games on modern machines, back when frame rate was pegged to cpu clock time, making playing them on modern computers way too fast. Great utility.
Another big difference between high-performance and low-performance CPUs is the number of cores available. This can realistically differ by a factor of 4, way more than the difference in clock frequency you're likely to encounter.
You can solve this by setting the thread affinity. Even IE6 will use 13 threads just to show google.com. That means it will benefit from a multi-core CPU. But if you set the thread affinity to one core only, all 13 IE threads will have to share that one core.
I understand that this question is pretty old, but here are some receipts I personally use (not only for Web development):
BES. I'm getting some weird results while using it.
Go to Control Panel\All Control Panel Items\Power Options\Edit Plan Settings\Change Advanced Power Settings, then go to the "Processor" section and set it's maximum state to 5% (or something else). It works only if your processor supports dynamic multiplier change and ACPI driver is installed correctly.
Run Task Manager and set processor affinity to a single core (or whatever number of cores you want) for your browser's (or any other's) process. Not a best practice for browsers, because JavaScript implementations are usually single-threaded, but, as far as I see, modern browsers actually DO use multiple cores.
There are a few different methods to accomplish this.
If you're using VirtualBox, go into the Settings for the VM you want to slow the CPU speed for. Go to System > Processor, then set the Execution Cap. The percentage controls how slow it will go: lower values are slower relative to the regular speed. In practice, I've noticed the results to be choppy, although it does technically work.
It is also possible to set the CPU speed for the whole system. In the Windows 10 Settings app, go to System > Power & Sleep. Then click Additional Power Settings on the right hand side. Go to Change Plan Settings for the currently selected plan, then click Change Advanced Power Plan Settings. Scroll down to Processor Power Management and set the Maximum Processor State. Again, this is a percentage. Although this does work, I find that in practice, it doesn't have a big impact even when the percentage is set very low.
If you're dealing with a videogame that uses DirectX or OpenGL and doesn't have a framerate cap, another common method is to force Vsync on in your graphics driver settings. This will usually slow the rendering to about 60 FPS which may be enough to play at a reasonable rate. However, it will only work for applications using 3D hardware rendering specifically.
Finally: if you'd rather not use a VM, and don't want to change a system global setting, but would rather simulate an old CPU for one specific process only, then I have my own program to do that called Old CPU Simulator.
The main brain of the operation is a command line tool written in C++, but there is also a GUI wrapper written in C#. The GUI requires .NET Framework 4.0. The default settings should be fine in most cases - just select the CPU you'd like to simulate under Target Rate, then hit New and browse for the program you'd like to run.
https://github.com/tomysshadow/OldCPUSimulator (click the Releases tab on the right for binaries.)
The concept is to suspend and resume the process at a precise rate, and because it happens so quickly the process will appear to just be running slowly. For example, by suspending a process for 3 milliseconds, then resuming it for 1 millisecond, it will appear to be running at 25% speed. By controlling the ratio of time suspended vs. time resumed, it is possible to simulate different speeds. This is completely API agnostic (it doesn't hook DirectX, OpenGL, etc. it'll work with a command line program if you want.)
Old CPU Simulator does not ask for a percentage, but rather, the clock speed to simulate (which it calls the Target Rate.) It then automatically determines, based on your CPU's real clock speed, the percentage to use. Although clock speed is not the only factor that has improved computer performance over time (there are also SSDs, faster GPUs, more RAM, multithreaded performance, etc.) it's a good enough approximation to get fairly consistent results across machines given the same Target Rate. It also supports other options that may help with consistency, such as setting the process affinity to one.
It implements three different methods of suspending and resuming a process and will use the best available: NtSuspendProcess, NtQuerySystemInformation, or Toolhelp Snapshots. It also uses timeBeginPeriod and timeEndPeriod to achieve high precision timing without busy looping. Note that this is not an emulator; the binary still runs natively. If you like, you can view the source to see how it's implemented - it's not a large project. On my machine, Old CPU Simulator uses less than 1% CPU and less than 1 MB of memory, so the program itself is quite efficient (unlike running intensive programs to intentionally slow the CPU.)