Mantis Bugtracker
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0007113 [Squeak] Kernel minor N/A 07-07-08 23:57 04-18-10 21:59
Reporter nicolas cellier View Status public  
Assigned To nicolas cellier
Priority normal Resolution fixed  
Status closed   Product Version 3.10
Summary 0007113: [ENH] Speed-up SmallInteger highBit and lowBit
Description Currently, algorithms are supposed to be fast for a one-byte-long and not optimized for a longer one.

I claim both cases can be speed up for highBit.
Provided code hereafter shows a gain between 30% and 40% for highBit.
I used a log: 2 power descent 16r10000 16r100 16r10
then finish with a 16 bytes array.
First test is a whileTrue: to handle future case of 64bits

For lowBit, I kept it fast for byte and suboptimal for longer.
I used a table of 16 bytes.
Speed-up ranges from 0% to 66%
Additional Information
{
[100000 timesRepeat: [123456798 highBit]] timeToRun.
[100000 timesRepeat: [122 highBit]] timeToRun.
[100000 timesRepeat: [12 highBit]] timeToRun.
[100000 timesRepeat: [3950591 lowBit]] timeToRun.
[100000 timesRepeat: [3950592 lowBit]] timeToRun.
[100000 timesRepeat: [8 lowBit]] timeToRun.
[100000 timesRepeat: [(-1073741824) lowBit]] timeToRun.
}

OLD-> #(289 188 184 90 242 177 3763)
NEW-> #(203 136 117 90 147 89 2769)
Attached Files  SmallInteger-highBit-lowBit-SpeedUp-M7113-nice.1.cs [^] (1,759 bytes) 07-08-08 00:28
 SmallInteger-highBit-lowBit-Test-M7113-nice.1.cs [^] (1,508 bytes) 07-08-08 00:28
 SmallInteger-highBit-lowBit-Test-M7113-nice.2.cs [^] (1,489 bytes) 07-08-08 00:49

- Relationships

- Notes
(0012349 - 81 - 81 - 81 - 165 - 165 - 165)
nicolas cellier
07-08-08 00:50

Uploaded a second test file in order to separate issue 0007114 (highBitOfMagnitude)
 
(0012350 - 205 - 259 - 259 - 259 - 259 - 259)
nicolas cellier
07-08-08 00:54

"fix begin"
Installer mantis bug: 7113 fix:'SmallInteger-highBit-lowBit-SpeedUp-M7113-nice.1.cs'.
"fix test"
Installer mantis bug: 7113 fix:'SmallInteger-highBit-lowBit-Test-M7113-nice.2.cs'.
"fix end"
 
(0013407 - 190 - 196 - 346 - 346 - 346 - 346)
nicolas cellier
11-27-09 19:27

fixed in http://source.squeak.org/trunk/Kernel-nice.306.mcz [^]
The version in trunk cache results for last 8 bits, not just last 4 bits as in 'SmallInteger-highBit-lowBit-Test-M7113-nice.2.cs'
 

- Issue History
Date Modified Username Field Change
07-07-08 23:57 nicolas cellier New Issue
07-08-08 00:28 nicolas cellier File Added: SmallInteger-highBit-lowBit-SpeedUp-M7113-nice.1.cs
07-08-08 00:28 nicolas cellier File Added: SmallInteger-highBit-lowBit-Test-M7113-nice.1.cs
07-08-08 00:49 nicolas cellier File Added: SmallInteger-highBit-lowBit-Test-M7113-nice.2.cs
07-08-08 00:50 nicolas cellier Note Added: 0012349
07-08-08 00:54 nicolas cellier Note Added: 0012350
01-10-09 02:13 Keith_Hodges Status new => pending
11-27-09 19:27 nicolas cellier Status pending => resolved
11-27-09 19:27 nicolas cellier Fixed in Version  => trunk
11-27-09 19:27 nicolas cellier Resolution open => fixed
11-27-09 19:27 nicolas cellier Assigned To  => nicolas cellier
11-27-09 19:27 nicolas cellier Note Added: 0013407
04-18-10 21:59 andreas Status resolved => closed


Mantis 1.0.8[^]
Copyright © 2000 - 2007 Mantis Group
54 total queries executed.
37 unique queries executed.
Powered by Mantis Bugtracker