Re: fun project - improving calcHash

2013-06-26 Thread Kagamin
In the case of high memory usage the input string is unlikely to be in cache, so may be it's better to optimize cache misses instead of computation speed.

Re: fun project - improving calcHash

2013-06-24 Thread qznc
On Sunday, 23 June 2013 at 21:22:40 UTC, Walter Bright wrote: https://github.com/D-Programming-Language/dmd/blob/master/src/root/stringtable.c#L21 Profiling shows the calcHash function is a significant contributor to compilation time (3.25% of total time). So making it faster is a win. Even

Re: fun project - improving calcHash

2013-06-24 Thread Martin Nowak
On 06/24/2013 03:43 AM, Juan Manuel Cabo wrote: I used words and lines from the complete works of Shakespeare. I tested separating the loop from the switch, as was suggested in Timon Gehr post. It didn't improve the speed when compiled with g++ -O3, though it improved it a bit without -O3.

Re: fun project - improving calcHash

2013-06-24 Thread qznc
On Sunday, 23 June 2013 at 21:22:40 UTC, Walter Bright wrote: https://github.com/D-Programming-Language/dmd/blob/master/src/root/stringtable.c#L21 Profiling shows the calcHash function is a significant contributor to compilation time (3.25% of total time). So making it faster is a win. Even

Re: fun project - improving calcHash

2013-06-24 Thread bearophile
qznc: To make dmd 1% faster, calcHash must be reduced to 69% run time. Does not look possible. I think the main problem to solve is to reduce the amount of memory used during the compilation. Bye, bearophile

Re: fun project - improving calcHash

2013-06-24 Thread deadalnix
On Monday, 24 June 2013 at 14:36:03 UTC, bearophile wrote: qznc: To make dmd 1% faster, calcHash must be reduced to 69% run time. Does not look possible. I think the main problem to solve is to reduce the amount of memory used during the compilation. Yes, my profiling show that were I

Re: fun project - improving calcHash

2013-06-24 Thread monarch_dodra
On Monday, 24 June 2013 at 15:29:55 UTC, deadalnix wrote: On Monday, 24 June 2013 at 14:36:03 UTC, bearophile wrote: qznc: To make dmd 1% faster, calcHash must be reduced to 69% run time. Does not look possible. I think the main problem to solve is to reduce the amount of memory used

Re: fun project - improving calcHash

2013-06-24 Thread Anders Halager
On Monday, 24 June 2013 at 11:11:42 UTC, qznc wrote: On Sunday, 23 June 2013 at 21:22:40 UTC, Walter Bright wrote: https://github.com/D-Programming-Language/dmd/blob/master/src/root/stringtable.c#L21 Profiling shows the calcHash function is a significant contributor to compilation time (3.25%

Re: fun project - improving calcHash

2013-06-24 Thread Walter Bright
On 6/24/2013 1:08 PM, Anders Halager wrote: Python is one of the slower interpreted languages. It would be more interesting to look at luajit which actually does something clever. If the string is at least 4 chars long it only hashes the first 4 bytes, the last 4, the 4 starting at

Re: fun project - improving calcHash

2013-06-24 Thread Anders Halager
On Monday, 24 June 2013 at 20:19:31 UTC, Walter Bright wrote: On 6/24/2013 1:08 PM, Anders Halager wrote: Python is one of the slower interpreted languages. It would be more interesting to look at luajit which actually does something clever. If the string is at least 4 chars long it only

Re: fun project - improving calcHash

2013-06-24 Thread Tyro[17]
On 6/24/13 5:56 PM, Anders Halager wrote: On Monday, 24 June 2013 at 20:19:31 UTC, Walter Bright wrote: On 6/24/2013 1:08 PM, Anders Halager wrote: Python is one of the slower interpreted languages. It would be more interesting to look at luajit which actually does something clever. If the

fun project - improving calcHash

2013-06-23 Thread Walter Bright
https://github.com/D-Programming-Language/dmd/blob/master/src/root/stringtable.c#L21 Profiling shows the calcHash function is a significant contributor to compilation time (3.25% of total time). So making it faster is a win. Even making dmd 1% faster would be a nice win - all those little

Re: fun project - improving calcHash

2013-06-23 Thread Timon Gehr
On 06/23/2013 11:22 PM, Walter Bright wrote: https://github.com/D-Programming-Language/dmd/blob/master/src/root/stringtable.c#L21 Profiling shows the calcHash function is a significant contributor to compilation time (3.25% of total time). So making it faster is a win. Even making dmd 1%

Re: fun project - improving calcHash

2013-06-23 Thread Juan Manuel Cabo
On 06/23/2013 06:22 PM, Walter Bright wrote: https://github.com/D-Programming-Language/dmd/blob/master/src/root/stringtable.c#L21 Profiling shows the calcHash function is a significant contributor to compilation time (3.25% of total time). So making it faster is a win. Even making dmd 1%

Re: fun project - improving calcHash

2013-06-23 Thread Martin Nowak
On 06/23/2013 11:22 PM, Walter Bright wrote: Profiling shows the calcHash function is a significant contributor to compilation time (3.25% of total time). So making it faster is a win. Even making dmd 1% faster would be a nice win - all those little drops add up. You'll find a benchmark at

Re: fun project - improving calcHash

2013-06-23 Thread Juan Manuel Cabo
On 06/23/2013 09:20 PM, Juan Manuel Cabo wrote: On 06/23/2013 06:22 PM, Walter Bright wrote: https://github.com/D-Programming-Language/dmd/blob/master/src/root/stringtable.c#L21 Profiling shows the calcHash function is a significant contributor to compilation time (3.25% of total time). So

Re: fun project - improving calcHash

2013-06-23 Thread Timothee Cour
On Sun, Jun 23, 2013 at 2:22 PM, Walter Bright newshou...@digitalmars.comwrote: https://github.com/D-**Programming-Language/dmd/blob/** master/src/root/stringtable.c#**L21https://github.com/D-Programming-Language/dmd/blob/master/src/root/stringtable.c#L21 Profiling shows the calcHash function

Re: fun project - improving calcHash

2013-06-23 Thread Michael
https://code.google.com/p/xxhash/ BSD 2-Clause License