Best way to clear dynamic array for reuse

2016-12-28 Thread Michael Rynn via Digitalmars-d-learn
It takes a bit of work to get around the mutable buffers problem in D language arrays. I found it made a performance difference in xml parsing. https://github.com/betrixed/dlang-xml/blob/master/xml/util/buffer.d /** Buffer(T) - Versatile appendable D array for buffer reuse, append,

Re: DMD 2.059 ??

2012-04-20 Thread Michael Rynn
On Thu, 12 Apr 2012 15:08:54 -0400, Matt Soucy wrote: On 04/12/2012 02:58 PM, Ali Çehreli wrote: On 04/12/2012 11:49 AM, Alvaro wrote: The changelog mentions DMD 2.059 as released on April 1, 2012, but there is no link to it. Is it released? http://dlang.org/changelog.html I don't think

Re: AA key conversion woes

2012-04-19 Thread Michael Rynn
or less complete and working interface for an aaA, I have made 2 different implementations, which use IAA http://bazaar.launchpad.net/~michael-rynn-500/d2-xml/d2-xml-dev/view/ head:/rt/aaSLink.d, a direct rip off, with above mentioned few warts erased, of the current rt.aaA implementation. and http

Re: Map with maintained insertion order

2012-03-25 Thread Michael Rynn
://bazaar.launchpad.net/~michael-rynn-500/d2-xml/trunk/view/head:/alt/ arraymap.d I took and adapted the idea from Ultimate++ library code. Ultimate++ is worth a try, even if it is C++. arraymap.d implements a hashmap, that will maintain insertion order, but only if no deletions are made. Each

Re: [xmlp] the recent garbage collector performance improvements

2012-02-25 Thread Michael Rynn
On Thu, 02 Feb 2012 15:44:56 +, Richard Webb wrote: With the xml package (xmlp) , and the linked node DOM, the GC is likely to fail cleanup. I divided the generated test file, with its 2 layer elements, into 5, 50, 500, 5000 sized files. I put in a mixin on the Node class to do

Std.xml is twice as slow on windows vs Linux. std.xml2 is pushing on.

2011-02-12 Thread Michael Rynn
to replace much more of the original source, so the speed advantage diminishes. Also the entire document stays in memory till the last reference is garbage collectable. Its all on dsource.org/xml/trunk/ Michael Rynn.

Re: High performance XML parser

2011-02-11 Thread Michael Rynn
On Mon, 07 Feb 2011 10:37:46 -0500, Robert Jacques wrote: On Mon, 07 Feb 2011 07:40:30 -0500, Steven Schveighoffer schvei...@yahoo.com wrote: On Fri, 04 Feb 2011 17:36:50 -0500, Tomek Sowiński j...@ask.me wrote: Steven Schveighoffer napisał: Here is how I would approach it (without doing

std.xml2 candidate

2010-12-11 Thread Michael Rynn
in std.xml. -- std.xmlp.arraydom. The arraydom DocumentParser is also faster than the std.xml, as it uses the std.xmlp.coreparse. Its not complete or final, nor much reviewed. The layout and interfaces seem to be OK. I expect its already more useful than std.xml. Michael Rynn.

Re: [due diligence] std.xml

2010-10-26 Thread Michael Rynn
On Tue, 19 Oct 2010 21:53:56 +0200, Jacob Carlborg wrote: On 2010-10-19 21:37, Andrei Alexandrescu wrote: More detail about the design please? I browsed through the code and the main issue seems to be heavy reliance on granular delegates to do pretty much anything. Would fixing that improve

Re: Fixing std.string

2010-08-24 Thread Michael Rynn
On Fri, 20 Aug 2010 02:22:56 +, dsimcha wrote: As I mentioned buried deep in another thread, std.string is in serious need of fixing, for two reasons: 1. Most of it doesn't work with UTF-16/UTF-32 strings. 2. Much of it requires the input to be immutable even when there's no good

Superhash buried in Druntime does super work.

2010-07-28 Thread Michael Rynn
I noted a little while ago here a mention of the superhash, someone was curious about it, and I found it hidden in the D runtime library Superhash , published online, From Hash Functions , Paul Hsieh http://www.azillionmonkeys.com/qed/hash.htm. Since I had an almost ready made hash

Re: D 2.0

2010-07-28 Thread Michael Rynn
The issue is that the scope keyword is impossible to check against escapes without extra additions to the language (e.g. marking a method or a function parameter as scoped). Such an uncheckable pattern is best left to a library feature, it doesn't deserve a keyword. I agree that scoped() has

Re: State of and plans for the garbage collector

2010-07-18 Thread Michael Rynn
On Thu, 15 Jul 2010 00:18:38 -0700, Jonathan M Davis wrote: Okay. I really don't know much about garbage collectors, how they work, or what makes one particularly good or bad Me too. But its a central part of the D langauge, its design and runtime. Even though D programmmers can replace

Re: Copy constructors for lazy initialization

2010-05-29 Thread Michael Rynn
On Fri, 28 May 2010 20:26:50 -0500, Andrei Alexandrescu wrote: Walter has had a great idea last night: allow classes to define this(ref S src); where S is the name of the struct being defined, as an alternative for this(this); The result would be a function similar with a C++ copy

Re: Copy constructors for lazy initialization

2010-05-29 Thread Michael Rynn
On Fri, 28 May 2010 20:26:50 -0500, Andrei Alexandrescu wrote: Walter has had a great idea last night: allow classes to define this(ref S src); where S is the name of the struct being defined, as an alternative for this(this); The result would be a function similar with a C++ copy

Re: Visual D released

2010-04-23 Thread Michael Rynn
On Sun, 18 Apr 2010 17:06:22 +0200, Rainer Schuetze wrote: Hello, I'd like to announce the initial release of Visual D, a Visual Studio package providing both project management and language services for integration of the D programming language into Visual Studio. The cv2pdb was already

Re: Druntime AA interface could be enhanced a bit

2010-04-13 Thread Michael Rynn
On Fri, 09 Apr 2010 12:08:54 -0700, Walter Bright wrote: Michael Rynn wrote: In playing around trying to understand and make a better AA, I have updated again the dsource/projects/aa/trunk/druntime/aaA.d, this time to be a single linked list version. I don't understand, the latest release

Druntime AA interface could be enhanced a bit

2010-04-09 Thread Michael Rynn
In playing around trying to understand and make a better AA, I have updated again the dsource/projects/aa/trunk/druntime/aaA.d, this time to be a single linked list version. In the template versions of various implementations, and in Java HashMap, I noticed that its nice to be able to

Re: Associative Arrays need cleanout method or property to help

2010-03-24 Thread Michael Rynn
so I don't see where the linear congruent random probe thingy is g. You *could* get rid of the left and right pointers and use linear congruent probing, and that might be worth a try. Thank you for the suggestion , I will give it a try. --- Michael Rynn

Re: Associative Arrays need cleanout method or property to help

2010-03-23 Thread Michael Rynn
. -- taf Michael Rynn.

Re: storing the hash multiplier instead of the hash value

2010-03-23 Thread Michael Rynn
. --- Michael Rynn

Re: Associative Arrays need cleanout method or property to help

2010-03-23 Thread Michael Rynn
On Tue, 23 Mar 2010 13:41:56 -0700, Walter Bright wrote: Michael Rynn wrote: On Mon, 22 Mar 2010 00:52:24 -0700, Walter Bright wrote: bearophile wrote: A way to know the usage patterns of D AAs is to add instrumentation in nonrelease mode, they can save few statistical data once

Re: Associative Arrays need cleanout method or property to help garbage collection

2010-03-17 Thread Michael Rynn
On Tue, 16 Mar 2010 16:12:25 +, Moritz Warning wrote: On Tue, 16 Mar 2010 04:41:55 +, Michael Rynn wrote: The use of built in Associative Array can have deleterious effects on Garbage Collection. :( Fwiw, here is the original Python Dictionary implementation: http

Re: Decimal Arithmetic module available

2010-03-16 Thread Michael Rynn
makes it a piece of superflous, redundent information. There are many roots more to choice from, and maybe it be nice to have the root module path be more informative? -- Michael Rynn

Re: Associative Arrays need cleanout method or property to help garbage collection

2010-03-16 Thread Michael Rynn
On Tue, 16 Mar 2010 16:12:25 +, Moritz Warning wrote: On Tue, 16 Mar 2010 04:41:55 +, Michael Rynn wrote: The use of built in Associative Array can have deleterious effects on Garbage Collection. :( Fwiw, here is the original Python Dictionary implementation: http

Associative Arrays need cleanout method or property to help garbage collection

2010-03-15 Thread Michael Rynn
The use of built in Associative Array can have deleterious effects on Garbage Collection. D by default uses garbage collection for memory management. This means that any blocks of memory that contain random bits can be mistaken as containing pointers to valid data, and can prevent complete

Re: GC.calloc with random bits causes slowdown, also seen in built in AA

2010-03-14 Thread Michael Rynn
a major overhaul, and I introduced a nasty bug that causes this. Please apply the fix identified here: http://www.digitalmars.com/webnews/newsgroups.php? art_group=digitalmars.D.announcearticle_id=17841 Sorry again. I hope this can be fixed soon. -Steve This particular progressive

Re: GC.calloc with random bits causes slowdown, also seen in built in AA

2010-03-12 Thread Michael Rynn
When there is such a drop in replacement, it will be easier for others to try it out in existing code and uncover quirks and limitations. Then there might be benefits. Committed a struct AA wrapper and a modified PyDict class in hash\pydict.d as builtin AA behave-alike, to the DSource - aa

GC.calloc with random bits causes slowdown, also seen in built in AA

2010-03-10 Thread Michael Rynn
removed on the release compile. The trie class however, at least can do prefix key completion well. PyDictD1 is updated with the same change. The code is updated in SVN, so anyone can check out the changes. (and even update with any Dsource login). --tof-- Michael Rynn

Re: Is D a cult?

2010-03-08 Thread Michael Rynn
On Mon, 08 Mar 2010 06:57:00 -0500, Hamish McTavish wrote: Jane Doe Wrote: Is D a cult? Who you calling a cult? http://en.wikipedia.org/wiki/Cult Cult pejoratively refers to a group whose beliefs or practices could be, reasonably or unreasonably, considered strange. The term was

Re: Empty array literals

2010-03-07 Thread Michael Rynn
That IS what Walter thinks, actually. It's being moved to libraries (which is why there have been some nasty AA regressions in the past few compiler releases :-( ). Sounds good. So the source is in druntime? Does that mean I can find out how to implement opIn ?. I found the file

Re: inheriting constructos

2010-03-07 Thread Michael Rynn
On Fri, 04 Dec 2009 10:05:16 +0200, Lionello Lunesu wrote: Perhaps reusing a constructor of an inherited class should be easier. Something like alias this? But how to refer to specific ctor overloads? L. On 30-11-2009 1:03, Andrei Alexandrescu wrote: Walter and I just discussed the

range properties that work in foreach

2010-03-06 Thread Michael Rynn
On the D2 online pages (http://www.digitalmars.com/d/2.0/statement.html#ForeachStatement)there is Foreach over Structs and Classes with Ranges My question is , is there a working example of foreach ( e ; range )? Iteration over struct and class objects can be done with ranges, which

Re: Array literals MUST be immutable.

2010-02-17 Thread Michael Rynn
image. Am I too pedantic or what? Michael Rynn...

Re: Array literals MUST be immutable.

2010-02-17 Thread Michael Rynn
]; // this should not be a literal, but memory allocated like a structure. Am I too pedantic or what? Michael Rynn...

Re: Array literals MUST be immutable.

2010-02-17 Thread Michael Rynn
be memory filled in dynamically at point of execution. If mypointers is static then it is immutable?. How does it work for struct? Michael Rynn...

Re: Making all strings UTF ranges has some risk of WTF

2010-02-05 Thread Michael Rynn
On Thu, 04 Feb 2010 18:41:48 -0700, Rainer Deyke wrote: Andrei Alexandrescu wrote: One idea I've had for a while was to have a universal string type: struct UString { union { char[] utf8; wchar[] utf16; dchar[] utf32; } enum Discriminator { utf8,

Re: Does functional programming work?

2010-01-04 Thread Michael Rynn
On Mon, 04 Jan 2010 04:10:28 +, retard wrote: Sat, 02 Jan 2010 12:23:36 -0800, Walter Bright wrote: yigal chripun wrote: Have you ever actually used Smalltalk?? I have used it and it's the easiest language to use by far, having conditionals as methods of Boolean is much better, easier

D2 struct as value in Associative Array (issue 1886) still not working.

2009-12-17 Thread Michael Rynn
elegant to wrap the struct contents in a class anyway. And this is probably a good thing. Still , its a bug in D2 types functionality. Michael Rynn

D2 struct as value in Associative Array (issue 1886) still not working.

2009-12-16 Thread Michael Rynn
the documentation what is the recommendation D2 struct opAssign. struct seems to work for most of the other facilities in D2. The DPL book fails to cover such intricasies, apart from the metaphorical There be Dragons... This is wise, since this is flunky. Michael Rynn

Re: XMLP

2009-11-17 Thread Michael Rynn
F:\DLang\DEx\D2ExF:\laguangeD\dlang\dtwo\dmd\windows\bin\dmd anoy.d object.d: Error: module object cannot read file 'object.d' F:\DLang\DEx\D2Ex What does this mean?I can compile all my d2 programs just use: dmd *.d under any path: I remember getting that same message compiling with

Re: Should the comma operator be removed in D2?

2009-11-17 Thread Michael Rynn
On Mon, 16 Nov 2009 18:57:13 -0600, Ellery Newcomer wrote: Bill Baxter wrote: Note that if comma-as-sequencer was removed, and repurposed as a tuple literal (with a,b making a tuple), and if we specify that tuple elements are evaluated in order, then I think this would work as a

XMLP

2009-11-16 Thread Michael Rynn
The XMLP project is on DSource. http://www.dsource.org/projects/xmlp I have got as far getting it to pass all the namespace and XML 1.0/1.1 test cases. I have been having a look at the w3c XPath recommendations, but I am still baulking at getting deep into that. -- michael *^^*

Re: The Thermopylae excerpt of TDPL available online

2009-11-03 Thread Michael Rynn
me a little worried, as I liked using the value returned by in operator, and had not used .get at all. P 128 20-25 ..To support this encoding, Unicode allocates no valid characters to numbers in the range 0xD800 through 0xDBFF Typo , should be: 0xD800 through 0xDFFF here. -- Michael Rynn

XML parser for D1 Phobos and Tango and D2 published

2009-11-01 Thread Michael Rynn
No one seems to be answering ad...@dsource.org. Either they or I am a dead person. Believing the former to be much more likely, I have setup , at least for the time being a server at http://source.miryn.org running trac and subversion. I am not a natural server admin or web designer, so

New XML parser written for D1 and D2. - XMLP_01.zip (0/1)

2009-10-14 Thread Michael Rynn
has a base module name of xmlp. I am not aiming for std.xml as yet. - Michael Rynn

New XML parser written for D1 and D2.

2009-10-14 Thread Michael Rynn
KB source code zip? - Michael Rynn

std2.xml and std2.encoding for D 1.0 available at D source

2009-08-12 Thread Michael Rynn
I have made a little beginning attempt at understanding the phobos xml modules. For a warm up exercise, I took the std.xml and std.encoding from phobos 2, and made them into std2.xml and std2.encoding in the DSource project std2, so the dmd 1.0 compiler took a tour tripping up all over the code.

Re: The XML module in Phobos

2009-07-30 Thread Michael Rynn
On Mon, 27 Jul 2009 20:15:46 -0400, llee l...@jhsph.edu wrote: The std.xml module contains several bugs that need to be fixed. The most important one is that the parser fails to parse empty elements (IE elements that use the tag name=value / format). I'd like to report this bug to the modules'

Re: The XML module in Phobos

2009-07-30 Thread Michael Rynn
On Thu, 30 Jul 2009 18:03:39 +1000, Michael Rynn michaelr...@optushome.com.au wrote: corrections.. I had little trouble in compiling a static library version of the Expat 2.01 Whoops, I used an import library to the LibExpat.dll. Pity I seen jobs yet offering for D language programmers. Any jobs