Domain: mikeash.com
Stories and comments across the archive that link to mikeash.com.
Comments · 28
-
Re:hold off or went elsewhere?
I still find it really funny when Apple fans repeatedly bring up the 64-bit processor ('the first introduced in a smartphone'), yet even the latest and most expensive iPhone still has only 3 GB of RAM. Boasting an accomplishment that has not been realized yet seems a bit silly in my opinion. I mean if Apple produced a series of smartphones with 4 GB+ to take advantage of the 64-bit register then I could understand the gloating but that has not happened yet.
Yeah, isn't it funny how the Fandroids always bring up the small memory of iPhones, when real life tests show how crappy memory management on Android phones is. Just look at round 2 of this speed test https://www.youtube.com/watch?v=OX4JucpvbJM
As for what advantages Apple gets from 64 bits, here's a >3.5 year old article exactly explaining it that even a Fandroid can understand. https://www.mikeash.com/pyblog/friday-qa-2013-09-27-arm64-and-you.html
-
Re:Suggestions anyone?
It was an iPhone 5c. It doesn't have the "secure enclave" that later models have, and is nowhere near as secure as these recent models, and by "recent", I mean anything that's a 5s or above.
See https://www.apple.com/business... for the gory details, or https://www.mikeash.com/pyblog... for a more readable version, but basically the secure enclave is designed to prevent brute-force attacks like the FBI wanted to use.
I'm reasonably certain that Apple's security team will have a larger remit on the next phone, to the extent that the secure enclave is invulnerable even to Apple (the above link speculates that it currently is not, and would therefore be vulnerable to a court warrant akin to the recent furore).
-
Re:Python/C++ Combo
No, Objective-C is also really damn fast.
Its method-dispatch is somewhat slower than C++'s, but it's by no means slow.
-
Re:32 vs 64
Indeed. In addition to that, Apple made optimizations to the ObjC runtime that only exist in the 64-bit variant (because they couldn't be made to the 32-bit variant without breaking backward compatibility). This article explains it in some detail.
-
Re:First 64bit
Many make the wrong assumption that 64 bit processor means only increasing the memory pointers to 64 bit. This is not the case with the transition from the A6 to the A7. The instruction set changed from ARMv7s to ARMv8 (or ARM64). There are performance gains to be made moving to a new, revised ISA for which 64 bit is but one of the characteristics. Further, Apple has been working on their toolchain and they can leverage certain software compiler improvements especially within the Objective C runtime, like tagged pointers and inline reference counting that are made possible with 64 bit pointers.
-
Re:New phone almost as fast as month old phone
The main advantage of 64 bitness is access to a far larger memory address space. Yes there can be a few minor performance improvements with proper use of larger registers, but it's really not that big an advantage. Until smartphones and tablets start exceeding 4 gigabytes of RAM there is really not much point other than marketing to use 64 bit code on such devices.
Oh c'mon. Slashdot is supposed to be the smart nerds.
One advantage of a 64 bit architecture (such as x86_64 or the A7) is that in order to hold 64 bit data. But if you're still working with 32 bit data (and most of us are), you can simply load each register with two 32 bit chunks, basically doubling the amount of data you can hold on chip, and the processor has functions to support this.
And if you look at what Apple did with the A7, not only does their 64 bit chip do this, but the new ARM64 specifications double the number of registers in general:
"The ARMv8-A instruction set doubles the number of registers of the A7 compared to the ARMv7 used in A6.[13] It now has 31 general purpose registers that are each 64-bits wide and 32 floating-point/NEON registers that are each 128-bits wide."
http://en.wikipedia.org/wiki/Apple_A7So basically you now have an crazy amount of registers, and an insane amount of registers if you are dealing with 32 bit data still. The NEON registers are 128-bits wide and there are 32 of them. If you have 32 bit data, you can process 128 chunks at a time! If you're working in float_16 with NEON, you can work through 256 chunks at a time. That's crazy good compared to ARM32. That would really speed up anything that works with media, images, video, animations, etc, most of which a modern window server does.
But that's not really the end of optimizations. If your registers are large enough, why bother using pointers? And that's what Apple did with the Objective-C runtime on ARM64.
http://www.mikeash.com/pyblog/friday-qa-2012-07-27-lets-build-tagged-pointers.htmlBasically, if you've got a small enough object type, like an object that holds an 32 bit type, you can skip the allocation of extra memory to hold this data, and just store it in the pointer itself. A lot of the low level and frequently hit methods in Obj-C (like the entire memory allocation tracking system) have been optimized for this, so you should see a speedup in even basic applications.
-
Re:If this was Apple...
What is the point of a 64-bit phone? Do you really need more than 4gb of RAM allocated to a single process on a phone?
http://www.mikeash.com/pyblog/friday-qa-2013-09-27-arm64-and-you.html - probably unsuited for the faux-nerds around here.
-
Re:Dinosour language
all the calls to methods as well as accesses to class properties are interpreted
.
It's also not quite true. Objective-c message passing is quite fast, only 4x the cost of a virtual table call in C++. If you are really interested in what happens behind the scene, see obj-c fast-path
Now, namespaces are still a honking good idea.
-
Not all that slow
Objective-C isn't necessarily that slow. Message passing can be about four times slower than C++ method invocation, but once cached, the two are comparable. (SEE here for some interesting stats.)
In a system as IO-heavy as GCC, your bottlenecks probably won't be your method calls / message passing. And as for being deterministic: why would a compiler have to be deterministic? There are no hard real-time considerations for compilers. Your variation in compile-times will be minimal, even with a non-deterministic GC.
I think your point 2 (typed) is fairly valid. Part of the reason to move to C++ is to provide a language that is more strongly-typed than C. While the run-time binding of Objective-C makes it a great language for some applications, it does remove some compile-time type checking. (You do get warnings about an object type's ability to process a message, of course, so you don't lose it all.)
-
Re:Multicore Enhancements!! :)
In your zeal to take one statement out of context, you missed the point of the framework. Using dispatch queues, I don't have to create threads, an expensive operation, and I don't have to agonize over performance profiles to determine the right number of threads to use. The operating system automatically maintains a global pool of worker threads based on available system resources, and you submit an asynchronous block of code which the system will assign to a thread and run for you based on current system state--that's what the "automatically distribute their work across all available cores" part means. Quite different from merely creating a pthread. Your code will run in an optimal number of threads for the system it's on, whether it's a Mac Mini Core Solo or an eight-core Mac Pro.
You can even distribute the iterations of a for-loop across queues using dispatch_apply(). Imagine doing a lot of expensive work on items in a collection, automatically threaded for the cores of the system it's running on. Here's an intro to Grand Central Dispatch. The followup articles on the site are also recommended.
The API to submit a block for asynchronous execution is very simple:
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
do_something_computationally_expensive();
});Posting anonymously since my "bonch" account has been modbombed.
-
Re:OK, I give up...what is it?
It's a bit like an easy-to-use thread pool. You submit blocks to queues, and the operating system assigns those queues to a number of threads it determines based on available system resources. It's a very easy API to use, often consisting of only a single function call to pass the block.
Here's an article with an introduction to GCD along with C examples.
-
Well, i know what would be fun to play with
unfortunatly, i have a mac mini aka 4 shaders.. but this screensaver lets you use the video card to do it, so i imagine it's fun to look at.
I just did a search, i didn't find anything about the largest. FWIW i'd LOVE to see the turing version in this screensaver :grin: -
Re:I concur
Memory is a real problem on OS X, especially with Apple programs. After Safari and Mail have been open for a while (say, a day or two), they get sluggish. Measuring memory is tricky, but Safari is almost always one of the first two or three processes in top sorted by rsize or vsize. (Is it bad if vsize for a single application exceeds the total RAM?)
I suspect that some programs have been conservative in their use of autorelease pools, causing garbage to lie around longer than necessary. I ran across this article the other day, which argues that you shouldn't be shy about creating pools. I'm hoping that garbage collection will help, but it may be a while before the majority of apps. are compiled for 10.5+.
-
Re:Looks like I'll stay with Tiger thenOr how apple charges you $40 for quicktime to play in full-screen mode, whereas Microsoft gives you that for free. First of all, QuicktimePro is $30. And you don't need it to play in full-screen mode, you just need a different player like the free QTAmateur. For some reason Windows programmers can't write something like this, so tough luck finding one for Windows. Oh well, writing malware probably pays more.
-
Re:Apple milking its users? I'm shocked!
If you want the Quicktime Pro features, consider QTAmateur. Every feature in Pro, and batch convert on top of that, for frees.
-
QTAmateur QuickTime Player
1.) GOTO http://www.mikeash.com/?page=software/qtamateur/i
n dex.html
2.) Download and install QTAmateur
3.) Bing! The nag screens are gone, as are the silly restrictions
4.) ...
5.) No, I'm not going to make a "PROFIT!" joke. Sorry. -
Concerning QT Pro...
If you just need it to unlock the QuickTime Player's basic functionality you might want to take a look at QTAmateur.
-
Re:Quicktime is no better
QT Amateur. QuickTime is more than just a Media Player. Infact the player that ships with it is just some sort of demo for what can be done with QT.
-
Re:A joke, I know, but...I always wondered why nobody has written a QuickTime Player for Windows yet. There are a couple for Macs, e.g. QT Amateur
Ohh, I see, this is a "I don't know what QuickTime actually is" problem on the part of all those leet Windows coders.
-
Re:Am I the only one?I recently downloaded QTAmateur, about the same time I also got QuickTime 7.0.3.
I opened a Movie, watched it, fine. I looked in the Menus, saw "Export", clicked it - and the selector was at "iPod (320x240)" (just at the bottom of the list, no settings available). I entered a filename, clicked "Export", and after (quite) some time out came a ".m4v" iTunes file with
AAC, Stereo, 44,100 kHz
H.264, 320 x 240, 16,7 Mill.
and a FPS of 23.98, the same as the original video. Since I don't have one of these fancy-shmancy iPods, I can't actually tell you if that video plays - but it's a pretty good guess.So getting the latest version of QT (which you'll need for the version of iTunes that links to the new iPods anyway AFAIK), and anything that can export the codecs of QT Standard - it can't be much easier.
-
Re:Don't Fall For This Trick!
It's just like the old statistic that airline travel is the safest. You'll hear that quoted a lot, but no one ever mentions the metric. It just so happens the metric is "safest per mile traveled." An airliner designed to go long distances at 550 mph obviously has the advantage here. Compare it by number of individual trips or hours spent traveling, and it turns out that the chance of fatality is about the same (or more).
According to this text file of dubious accuracy which I've saved, airline travel is three times safer than passenger cars when measured in fatalities per hour. -
Re:Why Airliners?
According to this file I keep on my web site, domestic airlines are significantly safer than bicycles on a fatalities-per-hour basis. How accurate that file is, I don't know, and if you have better figures I would love to see them.
-
Re:Plausible explanation -- though improbableYou find the possibility of quintillions of bacteria living for billions of years happening onto something that is improbable to be less plausible than the existence all-knowing all-seeing imaginary friend who has never revealed his presence in any way?
1) Mu. (I don't accept the premises.)
2) I'm very disheartened that someone could make this kind of trip, especially a Jew, and still not believe that God has revealed His presence in any way. Mind-boggling. Were you paying attention when they talked about the Six Day War? That alone ought to convert any skeptic.
-
speak for yourself.Slashdot's reader base is finding it more interesting to complain and play the victim than actually put some effort, thought, and most importantly creativity into improving their situation.
Actually, I recommend avoiding NDAs. Got any ideas yourself? I doubt it, seeing as you don't make your living in Engineering and are still wet behind the ears.
For self improvement, I've headed back to graduate school in an area that no one else wants anything to do with, Nuclear. My last job with a fortune 500 company was a real eye opener, however, and I'm afraid that I've wasted my time.
Fortune 500 companies, especially technical ones, have not hired people for decades. The last place I worked was filled with people over 50 in entry level positions who were routinly working 60 hour weeks. I've heard and seen this is true in other areas such as aerospace. I fear that these companies are dumb enough to think they can put their IP into place like India and have everything work out for them.
Current anti-competitive technology laws, such as DMCA, have the ability to reach back into all forms of engineering and design. Jobs lost to consolidation and outsourcing will never come back if people are not allowed to compete.
Someone who graduated with a BS last year should not be so cock sure about the future. That goes double for a Mac programmer who's tools and toys could be sent to Hyperbad tomorrow. Seeing that you are, in real life, an English teacher in France for a living, I wonder what you think you have to offer engineers on this subject. Do you have a real interest in this or do you just have fun trolling Slashdot with flames?
-
Tooting My Own Horn
I can't resist promoting my own product here, even though it's not free.
LiveDictionary is a program for Mac OS X that lets you look up words in Safari by just pointing at them with your mouse. It supports lots of bilingual dictionaries, including Japanese. It can be a great way to learn vocabulary, or to help you understand a web page that's in a language you're not very good with (which is why I wrote it in the first place), or just to understand the occasional unknown word when you're browsing in your second language, or even your first. -
Re:Tinfoil hatsIt appears he received his PhD in computer science from Stanford University. I gathered this information by clicking the link right below his username.
When I clicked the link below your usename, I got a picture of a teddy bear wearing sunglasses and a quote from Hermann Goering.
-
Re:CRT
Nothing helps a good joke like a humor-impaired moron pointing out the blindingly obvious.
P.S. Hey spambots:
mike@mikeash.com
mikeash@mikeash.com -
Re:CRT
Nothing helps a good joke like a humor-impaired moron pointing out the blindingly obvious.
P.S. Hey spambots:
mike@mikeash.com
mikeash@mikeash.com