Talk:Prime triangle: Difference between revisions

m
Swift - performance improvement
(Yes.)
m (Swift - performance improvement)
 
(3 intermediate revisions by 3 users not shown)
Line 4:
: Yes. ... I can get a 30% speedup on the C implementation by changing <tt>for (size_t i = 1; i + 1 != length; ++i) {</tt> to <tt>for (size_t i = 1; i + 1 < length; i+= 2) {</tt>.
 
: But I am leaving that alone for now -- this little laptop I am working on is so slow that the timings I would report would look like a significant slowdown even after that speedup (for me it's 1.64 seconds down to 1.25 seconds, and the code reports how long it takes to run). --[[User:Rdm|Rdm]] ([[User talk:Rdm|talk]]) 15:55, 21 April 2022 (UTC)
 
::Does Also,seem Ito wouldgive havea toworthwhile updateperformance myboost, attributionthanks commentNigel on- myI've Jadjusted entry.the VB.NET and Algol 68 samples accordingly. --[[User:RdmTigerofdarkness|RdmTigerofdarkness]] ([[User talk:RdmTigerofdarkness|talk]]) 1518:5527, 21 April 2022 (UTC)
 
::I've made this change to the C entry and a couple of my other ones. In the case of C++ and Swift (which is much slower than the others - about 12s?!) it made very little difference to the runtime so I've left them as is. --[[User:Simonjsaunders|Simonjsaunders]] ([[User talk:Simonjsaunders|talk]]) 21:29, 21 April 2022 (UTC)
:::Also applied to Swift now, and I've made it much faster by not using ArraySlice. --[[User:Simonjsaunders|Simonjsaunders]] ([[User talk:Simonjsaunders|talk]]) 07:49, 22 April 2022 (UTC)
1,777

edits