Changeset 165
- Timestamp:
- 05/03/07 12:05:35 (2 years ago)
- Files:
-
- trunk/benchmark/fasta.md (modified) (1 diff)
- trunk/benchmark/pidigits.md (modified) (1 diff)
- trunk/dsss.conf (modified) (1 diff)
- trunk/mdcl.zip (modified) (previous)
- trunk/minid/oslib.d (modified) (2 diffs)
- trunk/minid/types.d (modified) (6 diffs)
- trunk/samples/simple.md (modified) (1 diff)
- trunk/test.d (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/benchmark/fasta.md
r163 r165 1 module fasta;1 module benchmark.fasta; 2 2 3 3 // laptop: n = 25,000,000, 860 sec trunk/benchmark/pidigits.md
r162 r165 5 5 function Next(z) 6 6 { 7 return (3 zz* z[0] + z[1]) / (3 * z[2] + z[3]);7 return (3 * z[0] + z[1]) / (3 * z[2] + z[3]); 8 8 } 9 9 trunk/dsss.conf
r112 r165 2 2 3 3 [minid] 4 exclude = test.d mdcl.d minidc.d5 4 6 5 [mdcl.d] 7 6 target = mdcl 7 buildflags = -release -O -inline 8 8 9 9 [minidc.d] trunk/minid/oslib.d
r162 r165 33 33 import std.c.windows.windows; 34 34 } 35 else version(Unix) 36 { 37 import std.c.unix.unix; 38 alias timezone struct_timezone; 39 } 40 else version(linux) 41 { 42 import std.c.linux.linux; 43 } 35 44 else 36 { 37 import std.c.linux.linux; 38 } 45 static assert(false, "No valid platform defined"); 39 46 40 47 class OSLib … … 73 80 else 74 81 { 75 // Let's just assume that most other OSes besides Windows support gettimeofday()... 76 std.c.linux.linux.timeval tv; 82 timeval tv; 77 83 struct_timezone tz; 78 std.c.linux.linux.gettimeofday(&tv, &tz);84 gettimeofday(&tv, &tz); 79 85 s.push(cast(ulong)(tv.tv_sec * 1_000_000L) + cast(ulong)tv.tv_usec); 80 86 } trunk/minid/types.d
r164 r165 1994 1994 public MDValue* opIndex(MDString key) 1995 1995 { 1996 return opIn_r(key); 1996 Slot* slot = lookup(key); 1997 1998 if(slot is null) 1999 return null; 2000 2001 return &slot.value; 1997 2002 } 1998 2003 … … 2000 2005 { 2001 2006 scope str = MDString.newTemp(key); 2002 return opIndex(str); 2007 2008 Slot* slot = lookup(str); 2009 2010 if(slot is null) 2011 return null; 2012 2013 return &slot.value; 2003 2014 } 2004 2015 … … 2011 2022 mSlots[h].key = key; 2012 2023 mSlots[h].value = value; 2024 2025 if(h is mColSlot) 2026 moveColSlot(); 2013 2027 } 2014 2028 else … … 2034 2048 2035 2049 slot.next = &mSlots[mColSlot]; 2036 2037 for( ; mColSlot < mSlots.length; mColSlot++) 2038 if(mSlots[mColSlot].key is null) 2039 return; 2040 2041 grow(); 2042 2043 for(mColSlot = 0; mColSlot < mSlots.length; mColSlot++) 2044 if(mSlots[mColSlot].key is null) 2045 return; 2046 2047 assert(false, "MDNamespace.opIndexAssign"); 2050 moveColSlot(); 2048 2051 } 2049 2052 … … 2123 2126 continue; 2124 2127 2125 hash_t h = typeid(typeof(v.key)).getHash(&v.key) % newSlots.length;2128 hash_t h = v.key.toHash() % newSlots.length; 2126 2129 2127 2130 if(newSlots[h].key is null) … … 2150 2153 2151 2154 mSlots = newSlots; 2155 } 2156 2157 protected void moveColSlot() 2158 { 2159 for( ; mColSlot < mSlots.length; mColSlot++) 2160 if(mSlots[mColSlot].key is null) 2161 return; 2162 2163 grow(); 2164 2165 for(mColSlot = 0; mColSlot < mSlots.length; mColSlot++) 2166 if(mSlots[mColSlot].key is null) 2167 return; 2168 2169 assert(false, "MDNamespace.moveColSlot"); 2152 2170 } 2153 2171 } trunk/samples/simple.md
r164 r165 1 1 module simple; 2 2 3 3 4 class Base trunk/test.d
r164 r165 16 16 s = MDInitialize(); 17 17 MDFileLoader().addPath(`samples`); 18 MDFileLoader().addPath(`imports`);19 MDFileLoader().addPath(`benchmark`);20 18 21 19 MDGlobalState().importModule("simple");
