Re: Real simple unresolved external symbols question...

2021-02-11 Thread Imperatorn via Digitalmars-d-learn
On Thursday, 11 February 2021 at 00:18:23 UTC, H. S. Teoh wrote: On Wed, Feb 10, 2021 at 11:35:27PM +, WhatMeWorry via Digitalmars-d-learn wrote: [...] Okay, thanks. Then why does the README.md at https://github.com/dlang/druntime say "Runtime is typically linked together with Phobos in a

Re: Trying to reduce memory usage

2021-02-11 Thread frame via Digitalmars-d-learn
On Friday, 12 February 2021 at 02:22:35 UTC, H. S. Teoh wrote: This turns the OP's O(n log n) algorithm into an O(n) algorithm, doesn't need to copy the entire content of the file into memory, and also uses much less memory by storing only hashes. But this kind of hash is maybe insufficient

Re: Profiling

2021-02-11 Thread Imperatorn via Digitalmars-d-learn
On Wednesday, 10 February 2021 at 23:42:31 UTC, mw wrote: On Wednesday, 10 February 2021 at 11:52:51 UTC, JG wrote: As a follow up question I would like to know what tool people use to profile d programs? I use this one: https://code.dlang.org/packages/profdump e.g. ``` dub build

Re: how to properly compare this type?

2021-02-11 Thread Steven Schveighoffer via Digitalmars-d-learn
On 2/9/21 6:12 PM, Jack wrote: static if(is(typeof(__traits(getMember, A, member)) == string function(string))) That's not what you want. string function(string) is a *pointer* to a function that accepts a string and returns a string. In addition to getting the overloads (you only get one

Re: Trying to reduce memory usage

2021-02-11 Thread mw via Digitalmars-d-learn
On Friday, 12 February 2021 at 01:23:14 UTC, Josh wrote: I'm trying to read in a text file that has many duplicated lines and output a file with all the duplicates removed. If you only need to remove duplicates, keep (and compare) a string hash for each line is good enough. Memory usage

Re: Trying to reduce memory usage

2021-02-11 Thread H. S. Teoh via Digitalmars-d-learn
On Fri, Feb 12, 2021 at 01:45:23AM +, mw via Digitalmars-d-learn wrote: > On Friday, 12 February 2021 at 01:23:14 UTC, Josh wrote: > > I'm trying to read in a text file that has many duplicated lines and > > output a file with all the duplicates removed. > > If you only need to remove

Trying to reduce memory usage

2021-02-11 Thread Josh via Digitalmars-d-learn
I'm trying to read in a text file that has many duplicated lines and output a file with all the duplicates removed. By the end of this code snippet, the memory usage is ~5x the size of the infile (which can be multiple GB each), and when this is in a loop the memory usage becomes unmanageable