Computer >> 컴퓨터 >  >> 네트워킹 >> 인터넷

Opera 개발자 절전 - 마술 또는 과학?

저는 오페라의 열렬한 팬이 아닙니다. 나는 인공 호흡기에 가깝습니다. 오, 글쎄요. 어쨌든 최근에 이 브라우저는 이전 버전을 테스트한 다음 최신 릴리스를 테스트했을 때 두 번 내 레이더에 들어왔습니다. 내 프로덕션 설정에 큰 변화를 주거나 크게 신경을 쓸 정도로 감동을 주지는 못했습니다.

그러다가 Opera Developer에 새로운 절전 모드가 추가되어 노트북의 배터리 수명이 크게 향상된다는 소식을 읽었습니다. Google 크롬에 비해 무려 50%나 높습니다. 이는 특히 동일한 엔진을 공유하는 두 개의 브라우저에 대한 대담한 주장입니다. 이를 통해 Lenovo G50 시스템의 전원을 켜고 Gnome 데스크톱이 있는 Fedora 인스턴스로 부팅한 다음 실험을 시작했습니다.

설정에 대한 추가 정보

내가 읽은 모든 기사에서 Windows 10을 테스트 베드로 언급했습니다. 사실, 그들은 모두 Opera 팀의 주장을 참조하지만 그들 자신의 독립적인 테스트를 실제로 제공하지는 않았습니다. 문제는 전력 관리 및 측정이 까다롭다는 것입니다. 적어도 원시 전력 사용량과 배터리 소모 측면에서 브라우저를 운영 체제와 분리하는 것은 매우 어렵기 때문입니다. 주어진 몇 초 동안 수백 개의 프로세스가 실행 및 종료되고 많은 백그라운드 작업이 있으며 하드웨어가 작업을 수행하므로 모든 것이 정확한 과학이라기보다는 신비한 근사치에 가깝습니다.

또한 Linux는 어떻습니까? 글쎄, Fedora는 상당히 새로운 커널과 함께 제공되므로 우리는 전력 관리에서 최신의 가장 뛰어난 커널을 살펴보고 있으며 모든 주요 브라우저 릴리스를 이 특정 배포판에서 사용할 수 있는 것으로 보입니다. 또한 Linux 사람들이 이 새로운 절전 기능에 관심을 가질 필요가 있는지 더 잘 이해하는 데 도움이 될 것입니다.

테스트 조건

내가 하기로 결정한 것은 Opera 39, Google Chrome Stable(v50), Google Chrome Unstable(v52)을 설치하고 이미 사용 가능한 Firefox 46을 사용하는 것입니다. 이 시점에서 특정 개정은 덜 중요합니다. 우리는 나노와트를 추구하는 것이 아니라 Opera의 절전 모드를 사용할 때 배터리 수명이 실제로 의미 있는 방식으로 보존될 수 있는지 확인하고 싶습니다.

절전 기능은 두 가지 깔끔한 형태로 제공됩니다. 하나는 노트북의 플러그를 뽑고 화학 주스로 실행하기 시작하면 사용할 수 있는 절약 모드입니다. 둘째, 내장된 광고 블록을 사용하여 중단 횟수를 최소화하고 제3자 사이트에 의한 전원 공급 중단을 최소화하고 종종 화려한 형식으로 제공되는 광고를 읽을 수 있습니다. 활성화되면 Opera는 백그라운드 탭의 활동을 최소화하고, CPU 웨이크업을 줄이고, 플러그인과 애니메이션을 일시 중지하고, 비디오 재생을 최적화합니다.

아이디어는 정말 참신하게 들리지만 실제 이득은 일상적인 사용에서 눈에 띄게 중요합니까? 그럼 실험 설정을 확장해 볼까요? 그래서 우리는 네 개의 브라우저를 가지고 있습니다. 전력 사용량을 측정하는 명령줄 도구인 powertop도 있습니다.

그렇다면 브라우저에서 무엇을 시작해야 할까요? 저는 사계절과 같은 4개의 탭으로 이동하기로 결정했습니다. 제 웹사이트, Youtube, 보안 포럼, 특정 제품의 기본 설정에 대한 새 탭 페이지를 포함하여 덜 화려할 뿐입니다. 그런 다음 측정합니다.

테스트 주기에는 다음이 포함됩니다.

각 브라우저는 개별적으로 10초마다 3분 동안 샘플링되며 배포판이 백그라운드에서 임의로 수행하는 작업을 제외하고는 해당 시간에 시스템에서 다른 활동이 발생하지 않습니다. 브라우저는 새 탭이 로드된 상태로 전경에 있을 것입니다.

위의 내용 외에도 절전 모드가 켜져 있지만 광고 차단이 사용되지 않은 Opera Developer.

4개의 브라우저가 모두 로드되었으며 포그라운드에 있는 브라우저가 없었고 다시 Opera Developer에서 절전 기능을 켜고 껐으며 이전과 동일한 샘플링 빈도와 지속 시간을 사용했습니다.

Chrome Unstable과 Opera Developer는 전원 절약 기능을 켜고 끄고 전경에서 각각 모든 순열을 사용하여 3분 동안 샘플을 채취했습니다.

테스트

이것은 다소 흥미롭고 실망스러운 실험이었습니다. 한 시간 내내 작업을 안내할 수 있지만 약간 혼란스럽고 지루할 것입니다. 대신 하이라이트에만 집중하겠습니다.

처음에는 절전 모드가 다른 브라우저가 수행하는 작업에 관계없이 두 상태 사이에 약 1W 델타인 10%만큼 상당히 유익한 결과를 제공하는 것처럼 보였습니다. 그런 다음 Chrome, Stable 또는 Unstable에 비해 0.5-1W의 추가 절약이 있었습니다.

잠시 후 저는 절전 차이가 줄어들기 시작했고 몇 번의 측정에서 역전되었음을 알았습니다. Powertop은 마우스 커서 움직임, 텍스트 편집기 파일에 작업에 대한 문서화, 다른 응용 프로그램(특히 터미널, gedit 및 브라우저) 간의 Alt-Tab 동작을 포함하여 랩톱의 모든 활동에 매우 민감했습니다.

4개의 브라우저를 모두 가동하고 실행하면서 결과는 훨씬 더 모호해졌고 총 소비량은 큰 변화가 없었습니다. 유휴 시스템에 비해 평균 0.5W 미만으로 약 5% 절약됩니다. 아마도 내가 선택한 탭과 웹 사이트가 충분히 공격적이지 않았거나, 거의 모든 배포판에서 랩톱의 전체 배터리 수명이 상당히 비참함에도 불구하고 기본 절전 모드가 이미 상당히 공격적일 수 있습니다.

또한 각 브라우저가 자체적으로 얼마나 사용하고 있는지 이해하려고 노력했지만 다소 까다롭습니다. 기본적으로 powertop은 초당 이벤트 수와 소요 시간을 기준으로 전력 소비를 표시합니다. 값은 측정마다 크게 다릅니다. 예를 들어, 파이어폭스:

사용법 이벤트/s 카테고리 설명
258.7ms/s 136.7 프로세스 ...firefox
33.1ms/s 85.9 프로세스 ...firefox
69.6ms/s 106.7 프로세스 ...firefox
25.2ms/s 36.7 프로세스 ...firefox

사용량은 25 ~ 260ms/s(10배) 사이였습니다. 이벤트 수도 초당 36 ~ 136개로 매우 다양했습니다.

Chrome에서는 다중 프로세스 특성으로 인해 사용량을 측정하기가 더 어려웠습니다. Opera는 값이 밀리초가 아닌 마이크로초 단위이고 이벤트 수가 Firefox보다 10배(또는 2배) 적기 때문에 매우 가벼워 보였습니다. 하지만 powertop이 보여주는 엄청난 절감 효과에 어떤 식으로든 반영될 전력 사용의 전반적인 변화는 없었습니다. 그래서 무엇을 제공합니까?

사용법 이벤트/s 카테고리 설명
406.8 µs/s 2.3 프로세스 ...-개발자/운영자-
90.9µs/s 1.0 프로세스 ...-개발자/운영자-
42.9µs/s 0.7 프로세스 ...-개발자/운영자-

깊이 있는 결과

Here's what we have, a few snippets. Four browsers, power saving on:

The battery reports a discharge rate of 9.37 W
The estimated remaining time is 1 hours, 39 minutes

The battery reports a discharge rate of 11.2 W
The estimated remaining time is 1 hours, 23 minutes

The battery reports a discharge rate of 10.1 W
The estimated remaining time is 1 hours, 31 minutes

The battery reports a discharge rate of 9.44 W
The estimated remaining time is 1 hours, 37 minutes

The battery reports a discharge rate of 9.37 W
The estimated remaining time is 1 hours, 37 minutes

And now with power saving off:

The battery reports a discharge rate of 9.68 W
The estimated remaining time is 1 hours, 33 minutes

The battery reports a discharge rate of 10.6 W
The estimated remaining time is 1 hours, 25 minutes

The battery reports a discharge rate of 10.1 W
The estimated remaining time is 1 hours, 28 minutes

The battery reports a discharge rate of 9.91 W
The estimated remaining time is 1 hours, 30 minutes

The battery reports a discharge rate of 9.86 W
The estimated remaining time is 1 hours, 30 minutes

The battery reports a discharge rate of 10.0 W
The estimated remaining time is 1 hours, 28 minutes

The battery reports a discharge rate of 9.79 W
The estimated remaining time is 1 hours, 30 minutes

And turned on again:

The battery reports a discharge rate of 9.57 W
The estimated remaining time is 1 hours, 31 minutes

The battery reports a discharge rate of 10.2 W
The estimated remaining time is 1 hours, 25 minutes

The battery reports a discharge rate of 9.74 W
The estimated remaining time is 1 hours, 29 minutes

The battery reports a discharge rate of 10.0 W
The estimated remaining time is 1 hours, 26 minutes

The battery reports a discharge rate of 9.40 W
The estimated remaining time is 1 hours, 31 minutes

The battery reports a discharge rate of 9.90 W
The estimated remaining time is 1 hours, 26 minutes

Only Chrome Unstable and Opera Developer, power saving on, Opera in the foreground:

The battery reports a discharge rate of 9.84 W
The estimated remaining time is 1 hours, 25 minutes

The battery reports a discharge rate of 9.98 W
The estimated remaining time is 1 hours, 23 minutes

The battery reports a discharge rate of 9.80 W
The estimated remaining time is 1 hours, 24 minutes

The battery reports a discharge rate of 9.99 W
The estimated remaining time is 1 hours, 22 minutes

Chrome in the foreground, power saving still on:

The battery reports a discharge rate of 9.99 W
The estimated remaining time is 1 hours, 22 minutes

he battery reports a discharge rate of 9.51 W
The estimated remaining time is 1 hours, 25 minutes

The battery reports a discharge rate of 10.3 W
The estimated remaining time is 1 hours, 18 minutes

The battery reports a discharge rate of 9.93 W
The estimated remaining time is 1 hours, 20 minutes

The battery reports a discharge rate of 10.8 W
The estimated remaining time is 1 hours, 14 minutes

Power saving off, Chrome in the foreground:

The battery reports a discharge rate of 11.3 W
The estimated remaining time is 1 hours, 10 minutes

The battery reports a discharge rate of 9.93 W
The estimated remaining time is 1 hours, 19 minutes

The battery reports a discharge rate of 9.98 W
The estimated remaining time is 1 hours, 18 minutes

The battery reports a discharge rate of 10.8 W
The estimated remaining time is 1 hours, 12 minutes

Idle system:

The battery reports a discharge rate of 9.29 W
The estimated remaining time is 1 hours, 20 minutes

The battery reports a discharge rate of 9.27 W
The estimated remaining time is 1 hours, 18 minutes

So what do we have here?

The results are interesting. I didn't try to be all too methodical here. However, I did attempt to retain a modicum of science in my work. So we can see that in the two measurements with four browsers and power saving on, we had a 0.1W variation. But that's not quite correct. The actual STDEV was 0.79 W and 0.32 W, respectively. Likewise, for the measurements with power saving off, the deviation was 0.35 W, whereas the max. difference between the two modes (on/off) is 0.2 W in the best case, invalidating any improvements.

It gets better, though. With only two browsers running, with the power saving on, we had the same result as with four browsers. And then, in a second test, we had WORSE results than with four browsers. The one notable difference is that Chrome Unstable was in the foreground, and this resulted in a 0.21 W increase compared to Opera Developer being in the foreground, with the power saving active, and 0.6 W, with the power saving turned off, which aligns with what the Opera team promises in terms of background activity. The STDEV values for the three scenarios were:0.1 W, 0.48 W and 0.66 W, which again, makes all the results invalid in terms of improvements. One could claim, marginally, that there WAS a biggish and almost statistically noticeable difference with the power saving off and Chrome Unstable in the foreground, and this amounts to about 6% total power utilization.

The thing that seems certain is that the idle system does use less power than with browsers running, running at 9.28 W with a fairly stable measurement, but statistically almost as good as the four browser test with the power saving on. Which does not explain Firefox values in any way whatsoever. And then you have the urban myths, legends and whatnot saying how Chrome is a battery killer. Perhaps it is, and it seems to be more than the others. But I can't see the orders of magnitude differences that Firefox would need to have brought into the equation, not compared to Opera and not to Chrome.

What did we learn here?

Frankly, not much. And then, you may ask, what happens if you run Firefox with Noscript, which actually freezes everything and makes thing into static, quiet HTML. And what about adblocks? And then what kind of content do you need to be using and browsing to notice significant battery savings? How do you reliably measure browser-specific improvements unless we're talking hours of battery life and averaging hundreds of hours of work. Last but not the least, Windows. Maybe none of these lovely improvements come to bear in Linux in any shape or form, and I'm just chasing ghosts. But it's a valuable exercise.

It is also utterly unreliable. The total power usage on your laptop will depend on a million factors, including but not limited to:the specific kernel you're using and what kind of power management wizardry it has, whether your operating system has been optimized for your particular hardware, Intel versus ARM, Wi-Fi signal, overall activity, presence and intrusiveness of your security software, the number and type or running applications and processes, and so much more. In other words, you can all muddle it up beyond recognition, or in technical parlance, MUBAR.

결론

I don't think you will appreciate the vague message of this article, but it's a worthy lesson in trying to validate complex yet bombastic claims revolving around the most precious resource on mobile devices:spice. I mean battery life. Opera Developer promises some rather ambitious power savings, and it seems that the functionality does work, well, in some cases, at least a little bit. But only when pitted against Chrome, in very specific scenarios. Otherwise, for most people, the difference will probably not be huge or hugely noticeable.

Nothing I've done here is really foolproof. I have not done a full design of experiment, I've not done independent power measurements, nor isolated browsers from the background noise of the system, nor ran super-long, extensive tests that would encompass even more use cases, Javascript-rich computation and such. Which reminds me. This power thingie is much like browser speed tests. An exercise in what can be done, but something that is ultimately not that relevant to most people. I hope Opera proves everyone wrong, but I don't think we'll be seeing miracles anytime soon. Hey, even the official blog post is a little vague on the results, and it focuses on shorter tests with a high degree of confidence. What is 'high' exactly? Exactly.

All in all, even though I don't like Opera as a browser, I laud this approach. It's somewhat scientific, and it's trying to tackle a core issue that most people face. There's a lot more to be done, especially in quantifying the results, before we can go hallelujah on this one. Anyhow, I hope you liked this thingie. It took me longer than I thought, so you might as well appreciate all the sweat and tears and electrons than went into this effort.

건배.