Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dlang #23

Merged
merged 4 commits into from Apr 28, 2015
Merged

Dlang #23

merged 4 commits into from Apr 28, 2015

Conversation

tchaloupka
Copy link
Contributor

Make classes final, and add some attributes to methods definitions to speed up slightly

new BasicBlockEdge(cfg, _start, _end);
}
void buildConnect(int _start, int _end) {
BasicBlockEdge(cfg, _start, _end);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

???

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just an indentation caused by:

removed unneeded new because BasicBlockEdge is a struct

@kostya
Copy link
Owner

kostya commented Apr 27, 2015

oh, so many hacks, i dont like hacks, which make bad code readability, d not changed, ldc used 25s
also gdc fails to compile: havlak.d:35: error: safe function 'havlak.CFG.createNode' cannot call system function 'object.AssociativeArray!(int, BasicBlock).AssociativeArray.get' havlak.d:47: error: safe function 'havlak.CFG.getNumNodes' cannot call system function 'object.AssociativeArray!(int, BasicBlock).AssociativeArray.length'

@tchaloupka
Copy link
Contributor Author

So what about this?
Just added module level final to make all classes final (unfortunately not set as default in D), which has a "major" impact for results over the rest previously used attributes as @safe, pure, etc.
Replaced printf with writeln (no perf hit)
Changed constants to enums (no perf hit)
Removed new from struct initialization - not needed.

@kostya kostya merged commit 411c98f into kostya:master Apr 28, 2015
@kostya
Copy link
Owner

kostya commented Apr 28, 2015

thanks, but what this final means?

@tchaloupka
Copy link
Contributor Author

It means that final classes cannot be subclassed. In D all methods of class are virtual by default and being so means some ovehead calling them.
I dont understand this decision, but it is how it is ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants