The complete article is available here while I am working on the
details: http://www.conceptualspeech.com/DigitalConceptBuilder_article/DigitalConceptBuilder.html
Here are my concerns that I would appreciate fixed prior to the final
submission (which I would want to happen next week).
1) v8.lib is 100 MB... That is absolutely not reasonable. I am under
Win 32. I need some help in order to find a way to bring this to a
reasonable level for distribution without requiring people to install
v8's code and Python and scons is at all possible.
2) My pick of Google v8 was partially motivated by the statements that
it is the fastest Javascript engine around. I am not convinced of that
statement anymore. The execution of my code spends exactly the same
amount of time if it compiles the Javascript repeatedly versus if it
grabs the compiled Javascript from a cache. That is extremely
surprising to me. The source code is available from the URL specified.
If referring to ExecuteJavascriptString in JSObjectSupport.cpp, the
area to investigate would be there.
Handle<Value> ExecuteJavascriptString(Persistent<Context> context,
string dSourceStr, string nameStr, bool skiptrace, Handle<Script>
*dScript) throw(CMathematicalError)
{
Context::Scope context_scope(context);
Handle<Value> result;
Handle<String> source = String::New(dSourceStr.c_str());
Handle<Script> script;
if (dScript == NULL)
{
Handle<Value> name = String::New(nameStr.c_str());
{
TryCatch try_catch;
script = Script::Compile(source, name);
if (script.IsEmpty())
{
String::AsciiValue error(try_catch.Exception());
string tmpString = *error;
throw(new CMathematicalError(tmpString));
}
}
}
else
{
script = *dScript;
}
...
}
If the test "if (dScript == NULL)" is changed to "if (true)" then we
bypass the cache. You should see that by doing that, there was close
to no changes in the time spent calculating. That is extremely
surprising as Javascript files are compiled many times for each test-
case.
If someone could help me realign my expectations or make the code
changes in order to reach my expectations, I would appreciate the
help.
Thank you.
1) v8.lib is 100 MB... That is absolutely not reasonable. I am under
Win 32.
2) My pick of Google v8 was partially motivated by the statements that
it is the fastest Javascript engine around.
PS: if you're really throwing exceptions by pointer, instead of const reference, you REALLY should pick up a copy of Scott Meyers' "Effective C++".
Rest assure that I appreciate any constructive feedback such as the
ones that were communicated so far.
I will dig to see how scons work so that I could get my lib to a
reasonable size. If anyone has a specific posting that could easily be
referred, I would appreciate the input. I will try to find it on my
own in the meantime.
BTW, serious documentation should be made for a novice, such as
myself, and include these important details. It's a downer to have to
dig for basic information and to have to become an expert just to be a
user (I know that is part of the UNIX philosophy that everyone should
be an expert)...
Thank you
Could any of you give me the scons command to execute to get my
compile going with Visual Studio 2008?
The command that I have used is:
cons env="PATH:C:\Program Files\Microsoft Visual Studio
9.0\VC\bin;C:\Program Files\Microsoft Visual Studio
9.0\Common7\IDE;C:\Program Files\Microsoft Visual Studio
9.0\Common7\Tools,INCLUDE:C:\Program Files\Microsoft Visual Studio
9.0\VC\include;C:\Program Files\Microsoft
SDKs\Windows\v6.0A\Include,LIB:C:\Program Files\Microsoft Visual
Studio 9.0\VC\lib;C:\Program Files\Microsoft SDKs\Windows\v6.0A\Lib"
That gets it to compile and as stated in this thread the file
generated is way too large. I assume the way to get a smaller file is
not to compile it as a shared library... But I could still compile a
lib that is of more reasonable size.
I have looked around for the scons instructions but failed so far.
Your help is welcome.
I compiled v8 and v8.lib file is 93.7Mb. It is too large.
Compilation option is:
scons env="INCLUDE:C:\Program Files\Microsoft SDKs\Windows
\v6.1\Include;C:\Program Files\Microsoft Visual Studio 9.0\VC
\include,LIB:C:\Program Files\Microsoft SDKs\Windows\v6.1\Lib;C:
\Program Files\Microsoft Visual Studio 9.0\VC\lib"
Thank you.
Stephan, or somoeone else, could you send me the latest compiled lib?
I do not find the instructions to get it to a reasonable size and
really do not have much energy to get deeper into this issue.
Come on guys, I know someone has the solution... Throw it at me so
that I can go back to my 3 kids and play with them...
I agree with you the topic has been brought many times, but at no
point to my knowledge it is written clearly "Here's the solution".
And
by the solution, I mean here's the scons command for Visual Studio
2008 that will build you the library file that is reasonable in size.
Come on guys, I know someone has the solution... Throw it at me so
that I can go back to my 3 kids and play with them...
So far, the command...
scons mode=release library=shared env="PATH:C:\Program Files\Microsoft
Visual Studio 9.0\VC\bin;C:\Program Files\Microsoft Visual Studio
9.0\Common7\IDE;C:\Program Files\Microsoft Visual Studio
9.0\Common7\Tools,INCLUDE:C:\Program Files\Microsoft Visual Studio
9.0\VC\include;C:\Program Files\Microsoft
SDKs\Windows\v6.0A\Include,LIB:C:\Program Files\Microsoft Visual
Studio 9.0\VC\lib;C:\Program Files\Microsoft SDKs\Windows\v6.0A\Lib"
...build v8.lib (187K) and v8.dll (1.41MB) but results in these 2
linking errors in the code:
Error 1 error LNK2001: unresolved external symbol "public: static int
v8::internal::Internals::kJSObjectType"
(?kJSObjectType@Internals@internal@v8@@2HA) JSObjectSupport.obj DigitalConceptBuilder
Error 2 error LNK2001: unresolved external symbol "public: static int
v8::internal::Internals::kFirstNonstringType"
(?kFirstNonstringType@Internals@internal@v8@@2HA) Predicate.obj DigitalConceptBuilder
I am wondering if a recent add by someone which may have forgotten to
update the build file may be the cause of that.
Should I be able to get around these 2 linking errors, I would be in business.
Thank you
scons msvcltcg=off mode=release library=static snapshot=on ...
I haven't noticed serious performance degradation without Link Time
Code Generation.
[...]
> OK, I finally got v8 to work and the lib to a reasonable size. For the
> records, the lib file generated while creating the dll is the one to
> use. It is about 180 K in size. Then, one has to recompile the program
> that uses v8 with the preprocessor option USING_V8_SHARED and add the
> lib file to the project. Then, you need to ensure that v8.dll is in
> the working directory at startup.
Cool! So now, in the spirit of open source, you are going to add the
documentation on how to do this to the wiki, right? :)
—Jens
Somtimes, size does matter... I was working on an article that shows
how to perform conceptual analysis from textual input (that uses v8).
In order to post an article with a reasonable download size, I could
not integrate a 100 MB download into it. I fixed the issue by
compiling the shared library and taking the lib that resulted from
that compile instead.
BTW, the article in question is here:
http://www.codeproject.com/KB/recipes/DigitalConceptBuilder.aspx. It
does some pretty neat stuff with v8 and defines some nice artificial
intelligence tricks to deal with language to produce and manipulate
concepts.
Thank you.
Philippe Roy
2010/1/11 Søren Gjesse <sgj...@chromium.org>: