Skip to content

Switch profiles from Lua to library interface#2647

Merged
TheMarex merged 1 commit intomasterfrom
abstract-profile-interface
Jul 22, 2016
Merged

Switch profiles from Lua to library interface#2647
TheMarex merged 1 commit intomasterfrom
abstract-profile-interface

Conversation

@kkaefer
Copy link
Copy Markdown
Contributor

@kkaefer kkaefer commented Jul 11, 2016

There's now an abstracted interface and no direct calls to Lua anymore.

fixes #1974

/cc @TheMarex @daniel-j-h

@kkaefer kkaefer force-pushed the abstract-profile-interface branch from f6ebeb5 to 27495b1 Compare July 12, 2016 09:52
};

/**
* Creates a lua context and binds osmium way, node and relation objects and
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Doc is a little bit outdated now.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Changed

@TheMarex
Copy link
Copy Markdown
Member

Looks good. This shouldn't change any functionality and only add a slight overhead for virtual function calls but is much easier to reason about

Feeling good about including this after 5.3.0 since API doesn't change.

@TheMarex TheMarex added this to the 5.4.0 milestone Jul 13, 2016
@kkaefer kkaefer force-pushed the abstract-profile-interface branch 4 times, most recently from 2478cc3 to 422b096 Compare July 21, 2016 10:31
There's now an abstracted interface and no direct calls to Lua anymore.

fixes #1974
@TheMarex TheMarex force-pushed the abstract-profile-interface branch from 422b096 to 1309dd2 Compare July 22, 2016 13:04
@TheMarex TheMarex merged commit 1309dd2 into master Jul 22, 2016
@TheMarex TheMarex deleted the abstract-profile-interface branch July 22, 2016 13:04
@TheMarex
Copy link
Copy Markdown
Member

This is included in master now. 🎉

@springmeyer
Copy link
Copy Markdown
Contributor

springmeyer commented Sep 23, 2016

I re-read this PR in the contex of #2926. I cannot see any obvious problems that would cause an increase in memory usage. But I notice that locks are used when the GetLuaContext is called. Therefore I wonder if GetLuaContext were called a more often then more locking could cause less efficient allocation and therefore memory growth. Just a hunch, but going on this hunch I looked in the PR to see if more locks could be happening...

It seems like the answer is yes, but not many more. Would appreciate others eyes to rule this out. For example here the context was previously accessed once and then used in util::luaFunctionExists and RestrictionParser directly. After this PR the code is much cleaner but the context is accessed once when SetupSources() is called and a second time when RestrictionParser is created (due to the usage of scripting_environment.GetProfileProperties() inside its constructor). Now, creating the context twice rather than once may have no realworld performance penalty at all. But maybe it could? Or maybe there are other spots in the code that more locks are happening that I don't notice? //cc @kkaefer @MoKob @karenzshea

@daniel-j-h daniel-j-h mentioned this pull request Oct 6, 2016
4 tasks
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.

Switch profiles from Lua to library interface

3 participants