by user5994461 on 12/1/23, 1:11 PM with 108 comments
by rafram on 12/1/23, 2:27 PM
…Yes. Ever seen an image file with circular dimensions? No, because digital images (at least in standard formats) are always rectangles, sometimes with transparent areas that make them to appear to be other shapes.
There are so many shockingly basic misunderstandings in this post.
by ioulian on 12/1/23, 1:37 PM
The article mentions "The computer is doing a lot more work and recomputing the layout of the entire page.", but it's not true. As you see in his example, the square image is getting rotated but layout of the table does not change (the image clips out the table), so no layout recalculation is done.
So the "bug", must be somewhere else?
by dumbo-octopus on 12/1/23, 3:43 PM
VS Code experienced this same issue with the cursor blinking animation and some loading animations - there the best fix after dozens of attempts and some of the best JS perf engineers in the world looking at it was to actually move back to JS to show/hide the cursor on timeout. The only real "fix" for CSS animated things is to set `steps(30)` or whatever other low value to decrease the refresh rate, but that will make the thing stutter. There's no way to have efficient 60fps animations in chromium.
https://github.com/microsoft/vscode/issues/138396
https://github.com/microsoft/vscode/issues/22900
If anyone does know a fix, you could save the developer community about a metric ton of battery life hours worldwide if you share it with the above :)
by reddalo on 12/1/23, 1:39 PM
by selfhoster11 on 12/1/23, 1:38 PM
by Thaxll on 12/1/23, 2:02 PM
by h1fra on 12/1/23, 1:37 PM
by archerx on 12/1/23, 1:35 PM
CSS animations are a resource hog and I avoid having continuously running animations for this reason. For one site I wanted to have a background gradient slowly shift colors over time in an infinite loop but my laptop fan kept spinning on the page and the cpu usage was high so I scraped it.
by temp00112 on 12/1/23, 1:33 PM
'''In a real world app that is responsive and highly dynamic, like BitBucket, the page is usually adjusted to fit content, neighboring elements get pushed out to fit the rotating image, then neighboring and parents elements get adjusted too… the layout of the entire page is redone on every frame because of the rotating image.'''
transform translations doesn't make the browser recalculate the layout for neighbour elements
by 0xbadcafebee on 12/1/23, 3:24 PM
It's bizarrely been on life support forever. Atlassian doesn't seem to want to invest in it, despite the fact that the hosted VCS landscape isn't that big, and they've had a huge opportunity to steal business by converting GitHub Enterprise customers to a Bitbucket offering with cheaper deals from bundling with other Atlassian products. Despite all this, there isn't a single solitary reason to adopt Bitbucket, unless using GitHub and GitLab are forbidden.
We stay on Bitbucket because we don't want to invest the money and time it'll take to move off. But we know that we will move eventually, because the competition is just better in every way. I can't say that about the rest of Atlassian's products.
by pharmakom on 12/1/23, 1:47 PM
by zerop on 12/1/23, 1:32 PM
by imedadel on 12/1/23, 1:54 PM
by bluedino on 12/1/23, 4:29 PM
Security decided that any Linux VM needs Microsoft Defender ATP installed. Okay.
It was installed by the DevOps team on all the VM's in Azure. Many, many people reported that their machines were now using 100% CPU, or 1 of their multiple CPUs were pegged by a defender process. This isn't uncommon.
Solution? Devops added cores to all machines. Wonder how much that bumped up the bill.
by peter_d_sherman on 12/1/23, 3:42 PM
o Give me flamegraphs of all the computing resources a given web page is using; CPU, processes, threads, fibers, specific methods/procedures/functions inside of the Browser... also, be able to selectively disable and keep disabled, on a granular level (by web page/URL) things that use resources beyond a certain amount, for example, in the article's case, a buggy animation -- but more generically any resource or browser process or sub-process that is taking too much CPU time and/or other computing resources (RAM, I/O, Network, GPU etc.)...
(Yes, including those "power user" features could lead to the selective reduction of functionality for some web pages -- but the user should always be able to determine exactly what they want and what they don't want from any given web page...)
by artursapek on 12/1/23, 1:36 PM
by mgaunard on 12/1/23, 2:06 PM
They should just display stuff, not run silly animations or do calculations in the background.
by Kiro on 12/1/23, 1:38 PM
by gwbas1c on 12/1/23, 3:24 PM
One of the reasons why I loved Chrome when it came out was that the multi-process architecture made it easy to kill a Chrome process without closing all my open tabs: The offending tag would "crash," but otherwise I could continue browsing.
Also, around that time there was an ad on Slashdot that gobbled CPU. I remember quickly figuring out that it was the ad, grabbing a screenshot, and emailing them. I got back a quick knowledgeable reply (and apology).
by SV_BubbleTime on 12/1/23, 3:37 PM
But going with BitBucket seems like a foot gun.
by FesterCluck on 12/1/23, 1:59 PM
by dzaima on 12/1/23, 2:07 PM
by linsomniac on 12/1/23, 1:45 PM
by l33tman on 12/1/23, 2:50 PM
by smusamashah on 12/1/23, 2:51 PM
by lagniappe on 12/1/23, 2:12 PM
by Phelinofist on 12/1/23, 2:36 PM
by gempir on 12/1/23, 1:49 PM
I think the only reason it got so many points is because it's a hate on Atlassian thread.
The implementation seems perfectly normal, I would guess 90% of all developers would implement an animation this way.
by jxf on 12/1/23, 2:45 PM
by sharts on 12/1/23, 4:34 PM
by zackmorris on 12/1/23, 7:07 PM
Here is an AppleScript I've hacked together over time to show the Safari tab for a PID from Activity Monitor so it can be closed, note that I'm on macOS 10.13.6 on this old 2011 Mac Mini, using Safari 13.1.2, so YMMV:
-- launch Activity Monitor to find the PID of a misbehaving tab and show it with this script
-- ensure that Safari->Debug->Miscellaneous Flags->Show Web Process IDs in Page Titles is enabled
tell application "System Events" to tell process "Safari"
-- ensure that user has enabled assistive access
try
menu 1 of menu bar item "Safari" of menu bar 1 -- throws exception if menu not visible
on error
display dialog "Please enable assistive access for this script by dragging it into the list of apps in:
System Preferences->Security & Privacy->Privacy->Accessibility
(It must be disabled and re-enabled each time this script is edited)" buttons {"OK"} default button "OK"
return
end try
-- ensure that user has enabled Show Web Process IDs in Page Titles
try
set debugMenu to menu 1 of menu bar item "Debug" of menu bar 1 -- throws exception if menu not visible
on error
display dialog "Enable Debug menu in Safari? It will be relaunched but preserve any open windows." -- stops script if Cancel is clicked
do shell script "defaults write com.apple.Safari IncludeInternalDebugMenu 1 && killall Safari && osascript -e 'tell application \"Safari\" to activate'" -- force quit Safari to preserve windows on relaunch
return
end try
tell menu item "Show Web Process IDs in Page Titles" of menu 1 of menu item "Miscellaneous Flags" of debugMenu
if (value of attribute "AXMenuItemMarkChar" as string) is "missing value" then click
end tell
end tell
-- show tab matching string, prepopulated with [WP _pid_]
set searchString to text returned of (display dialog "Please enter a string to find the Safari tab containing it:
([WP _pid_] from Activity Monitor for convenience)" default answer "[WP _pid_]")
tell application "Safari"
-- bring frontmost to avoid App Tamer from slowing script
activate
repeat with w from 1 to count of windows
repeat 1 times
try
set theTab to (first tab of window w whose name contains searchString)
on error
exit repeat
end try
set current tab of window w to theTab
-- work around a bug/feature of Safari where windows lack a way to bring them to front
if index of window w is not 1 then
set index of window w to 2
tell application "System Events"
tell application process "Safari"
keystroke "`" using command down
end tell
end tell
end if
return
end repeat
end repeat
display dialog "Couldn't find tab containing \"" & searchString & "\"." buttons {"OK"} default button "OK"
end tell
Just open Script Editor, paste it in and save it as an application under ~/Library/Scripts or by choosing Script menu->Open Scripts Folder->Open User Scripts Folder. The Script menu can be shown via Script Editor->Preferences->General->Show Script menu in menu bar. Then run it and follow the prompts to ensure that assistive access has been enabled and that tabs show their PID.The script is loosely derived from:
https://hea-www.harvard.edu/~fine/OSX/safari-tabs.html
https://apple.stackexchange.com/questions/45768/how-can-i-fi...
I tried to make a version that just shows the Safari tab having a pid, but lost a day to it doing a deep dive into listing windows and their pid:
https://stackoverflow.com/questions/48058409/get-windows-wit...
https://stackoverflow.com/questions/14551419/listing-all-win...
https://stackoverflow.com/questions/42018149/get-pids-of-all...
Unfortunately Apple made AppleScript and Automator so arduous to use that I consider them adversarial programming. Like with MS Visual Basic, there's usually less than 50% odds of getting a script to work, regardless of how experienced the developer is. Certainly 0% without resources like web forum posts.
Web browsers are even worse, in the sense that they're written for users instead of developers. Some low-hanging fruit would be to pause all non-focused tabs after a configurable period of time, so that they only use memory. I've wanted that since I first saw NCSA Mosaic in 1995, along with a great many other improvements which the powers that be seem to work tirelessly to prevent. Blah.