5 ms·
"The company says that Swift apps are significantly faster than Objective-C apps, outperforming them by over 93x." With a graph showing ObjC at 127x faster tha
by kjjw 12y ago
"The company says that Swift apps are significantly faster than Objective-C apps, outperforming them by over 93x."
With a graph showing ObjC at 127x faster than Python, Swift 220x faster than Python.
Thus the conclusion is 220 - 127, Swift is 93x faster than ObjC.
Someone needs to resit their GCSEs.
- maaaats 12y agoFor context: This story previously pointed to an article, but has now been changed to point to Apple.
- cjslep 12y ago"93x faster" sounds roughly like a 46.5x improvement in marketing.
- stcredzero 12y agoIt's not only possible, it's even not uncommon for a C programmer to get a 90X improvement in speed in their own C program. If you have naive memory management, or incorrectly implemented concurrency or parallelism, you can easily lose 2 orders of magnitude speed.
- cjslep 12y agoMy most painful personal experience dealing with this exact problem was with CUDA warps, during my undergrad research work.
- pling 12y agoThis. In my case a 1Mbyte memcpy in the middle of a loop this morning. Enough to blow the CPU cache out of the water... 300x improvement instantly by moving it out of the loop.
- dbaupp 12y agoAre you sure it wasn't just because you were then no longer doing a large memcpy repeatedly?
- pling 12y agoYes it was entirely covered by that :) I think it was covered by "naive memory management" and "shitty outsourcing". I'm paid to fix their stuff.
- dbaupp 12y agoIf the problem was just the time taken to do a 1MB copy inside a loop, why did you say the problem was clearing the CPU caches?
- pling 12y agoBecause the CPU has 32k of cache in this case (ARM) so the memcpy was evicting the entire cache several times in the loop as a side effect of doing the work. The actual function of the loop had good cache locality as the data was 6 stack vars totalling about 8k.
- dbaupp 12y agoSo? Copying a megabyte is a really expensive thing to do inside a loop, even ignoring caches. (A full speed memcpy would take 40 microseconds, based on a memory bandwidth of 24 GB/s, which is a long time.)
- tomp 12y agoHaha :) Maybe the shipped a better product, but the management said "No, it's not possible that this could run that fast. Something must be wrong.", so they put in some "waiting".
- _deh 12y agoMarketing are claiming a 91.3x.
- deleted 12y ago[deleted]
- deleted 12y ago[deleted]
- bendyorke 12y ago"outperforming them by over 93x" is technically different than "93x faster"... Although I agree it is a cheap way to put it :)